diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-06-22 18:23:55 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-06-22 18:33:13 (GMT) |
commit | 1b590314d9dd01871d6cd640d1e1c1a079132409 (patch) | |
tree | 5db86224cad9320c92b7aadccf9ea066d803c2c0 | |
parent | 789a9b0db3386a2291071e7e382fa283c09317c9 (diff) |
Catch OSError in the allow/inhib suspend methods
If the file does not exists, is a OSError, not IOError
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | activity.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activity.py b/activity.py index 41678cb..8189aee 100644 --- a/activity.py +++ b/activity.py @@ -231,7 +231,7 @@ class ImageCollectionViewer(gtk.VBox): try: file(flag_file_name, 'w').write('') logging.debug("inhibit_suspend file is %s", flag_file_name) - except IOError: + except OSError, IOError: pass def _allow_suspend(self): @@ -240,7 +240,7 @@ class ImageCollectionViewer(gtk.VBox): try: os.unlink(flag_file_name) logging.debug("allow_suspend unlinking %s", flag_file_name) - except IOError: + except OSError, IOError: pass def _powerd_flag_name(self): |