From a8112d8ecf994722b77ae55bc22fcc57e14b27a9 Mon Sep 17 00:00:00 2001 From: William Witt Date: Wed, 22 Sep 2010 22:30:57 -0500 Subject: [PATCH] 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 --- usr/lib/linuxmint/mintMenu/plugins/filemonitor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py index 57bd228..86be990 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py +++ b/usr/lib/linuxmint/mintMenu/plugins/filemonitor.py @@ -23,11 +23,13 @@ if hasInotify: def addMonitor( self, filename, callback, args = None ): - mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY - mId = self.wm.add_watch( filename, mask, rec = True)[filename] - if mId >= 0: - self.callbacks[mId] = ( callback, args ) - + try: + mask = pyinotify.IN_DELETE | pyinotify.IN_CREATE | pyinotify.IN_MODIFY + mId = self.wm.add_watch( filename, mask, rec = True)[filename] + if mId >= 0: + self.callbacks[mId] = ( callback, args ) + except Exception, e: + mId=0 return mId def removeMonitor( self, monitorId ):