# lock it to prevent two processes run in parallel.
lock_file = open("xsetbg.py", 'r')
try:
- flock(lock_file , LOCK_EX|LOCK_NB)
+ flock(lock_file, LOCK_EX|LOCK_NB)
except IOError: # already locked
lock_file.close()
return
finally:
# Unlock and close the lock file
- flock(lock_file , LOCK_UN)
+ flock(lock_file, LOCK_UN)
lock_file.close()
# Flush and close the global persistent dictionary
if global_db: global_db.close()