python-inotify 0.9.0 causes an exception when a file is not found
- Causes Favorites list to be blank if python-inotify is install in Fedora
This commit is contained in:
parent
dc9f8840a6
commit
5b8975037a
@ -23,11 +23,13 @@ if hasInotify:
|
|||||||
|
|
||||||
|
|
||||||
def addMonitor( self, filename, callback, args = None ):
|
def addMonitor( self, filename, callback, args = None ):
|
||||||
|
try:
|
||||||
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
|
mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY
|
||||||
mId = self.wm.add_watch( filename, mask, rec = True)[filename]
|
mId = self.wm.add_watch( filename, mask, rec = True)[filename]
|
||||||
if mId >= 0:
|
if mId >= 0:
|
||||||
self.callbacks[mId] = ( callback, args )
|
self.callbacks[mId] = ( callback, args )
|
||||||
|
except Exception, e:
|
||||||
|
mId=0
|
||||||
return mId
|
return mId
|
||||||
|
|
||||||
def removeMonitor( self, monitorId ):
|
def removeMonitor( self, monitorId ):
|
||||||
|
Loading…
Reference in New Issue
Block a user