Changeset efbd885d7c8e6cecb1c6fccc45f845249630e0e1

Show
Ignore:
Timestamp:
06/29/07 02:39:46 (6 years ago)
Author:
dsmith <dsmith@…>
Children:
1c06490e971a413d37373d5eb89a236149e61a94
Parents:
cfb368e1db62670a62e73af5ee589e663e9dc999
git-author:
L. Donnie Smith <donnie.smith@…> (06/29/07 02:39:46)
git-committer:
dsmith <dsmith@…> (06/29/07 02:39:46)
Message:

supress wminput errors for nonexistent python plugins

git-svn-id: http://abstrakraft.org/cwiid/svn/trunk@133 918edb2d-ff29-0410-9de2-eb38e7f22bc7

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rbb2d26b refbd885  
    88        wminput 
    99        * rewrote ir_ptr plugin 
     10        * supress error for nonexistent python plugins 
    1011 
    11122007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> 
  • wminput/py_plugin.c

    ra498060 refbd885  
    1616 * 
    1717 *  ChangeLog: 
     18 *  2007-06-28 L. Donnie Smith <cwiid@abstrakraft.org> 
     19 *  * supress error for nonexistent python plugins 
     20 * 
    1821 *  2007-06-18 L. Donnie Smith <cwiid@abstrakraft.org> 
    1922 *  * revised error messages 
     
    201204        PyObject *handle, *info; 
    202205        PyObject *PyStr; 
     206        PyObject *PyErrType, *PyErr, *PyTraceback; 
    203207 
    204208        if (!(PyStr = PyString_FromString(dir))) { 
     
    213217 
    214218        if (!(handle = PyImport_ImportModule(plugin->name))) { 
    215                 /* TODO: print only syntax errors, not "module not found errors" */ 
    216                 PyErr_Print(); 
     219                /* ignore "module not found" errors in top level module */ 
     220                PyErr_Fetch(&PyErrType, &PyErr, &PyTraceback); 
     221                PyErr_NormalizeException(&PyErrType, &PyErr, &PyTraceback); 
     222                if (PyErr_GivenExceptionMatches(PyErr, PyExc_ImportError) && 
     223                  !PyTraceback) { 
     224                        Py_XDECREF(PyErrType); 
     225                        Py_XDECREF(PyErr); 
     226                } 
     227                else { 
     228                        PyErr_Restore(PyErrType, PyErr, PyTraceback); 
     229                        PyErr_Print(); 
     230                } 
     231 
    217232                if (PySequence_DelItem(PyPath, 0)) { 
    218233                        PyErr_Print();