From: Oleg Broytman Date: Fri, 21 Apr 2006 22:27:52 +0000 (+0000) Subject: The key may be absent in the DB. X-Git-Tag: v4.0.0~55 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=de1db96fc3ee52f43d38c1f042e7ffb545b187ca;p=xsetbg.git The key may be absent in the DB. git-svn-id: file:///home/phd/archive/SVN/xsetbg/trunk@13 143022c7-580b-0410-bae3-87f2bf5d3141 --- diff --git a/xsetbg.py b/xsetbg.py index bca8f45..e3f3365 100755 --- a/xsetbg.py +++ b/xsetbg.py @@ -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