]> git.phdru.name Git - xsetbg.git/blobdiff - xsetbg.py
Convert the filename to unicode (to split by characters, not bytes).
[xsetbg.git] / xsetbg.py
index bca8f45f1144672de38c5ab4fd5bc0977d32dd04..c2b994887464a2d6a700ee1ebdeea67080c7fb91 100755 (executable)
--- a/xsetbg.py
+++ b/xsetbg.py
@@ -1,4 +1,4 @@
-#! /usr/local/bin/python -O
+#! /usr/bin/env python
 """Set a random background image (XWin)
 
 Select a random image from a (list of) directory(s)
@@ -139,7 +139,10 @@ for key in global_db.keys():
       to_delete.append(key)
 
 for key in to_delete:
-   del global_db[key]
+   try:
+      del global_db[key]
+   except KeyError:
+      pass
 
 global_db.close() # Close DB in the parent process