From 5b8975037acb5d1c2b45025046f3187ba0db3823 Mon Sep 17 00:00:00 2001 From: William Witt Date: Thu, 23 Sep 2010 11:30:57 +0800 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 ):