Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/GetIABooksActivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@sugarlabs.org>2011-04-14 18:17:37 (GMT)
committer Gonzalo Odiard <godiard@sugarlabs.org>2011-04-14 18:20:30 (GMT)
commit8704d86c6c74ecc3112e5d64cda13840a2111720 (patch)
tree0cad262a7afe83510febb9d1514669a6c1ec283f /GetIABooksActivity.py
parent4fdab96973d992c14e27e14cec570db72bbc305e (diff)
Check if file is present before unlink suspend flag file
Diffstat (limited to 'GetIABooksActivity.py')
-rwxr-xr-xGetIABooksActivity.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/GetIABooksActivity.py b/GetIABooksActivity.py
index 9ac3506..34a496b 100755
--- a/GetIABooksActivity.py
+++ b/GetIABooksActivity.py
@@ -158,7 +158,8 @@ class GetIABooksActivity(activity.Activity):
def _allow_suspend(self):
if self.using_powerd:
- os.unlink(POWERD_INHIBIT_DIR + "/%u" % os.getpid())
+ if os.path.exists(POWERD_INHIBIT_DIR + "/%u" % os.getpid()):
+ os.unlink(POWERD_INHIBIT_DIR + "/%u" % os.getpid())
logging.error("allow_suspend unlinking %s" % POWERD_INHIBIT_DIR \
+ "/%u" % os.getpid())
return True