summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenko Rasic <senko.rasic@dobarkod.hr>2011-06-10 10:16:58 (GMT)
committerSenko Rasic <senko.rasic@dobarkod.hr>2011-06-10 10:16:58 (GMT)
commit40eef7578246abd68960992ab096e3eb17e94573 (patch)
tree3ca5e2bcfa465c58dcd770b0c4d52638c052f3a8
parent13f9967a07ece99e85c8704cfc164afcc64d162b (diff)
downloadgtimelog-master.tar.gz
gtimelog-master.tar.xz
don't crash if gnome keyring is not availableHEADmaster
-rwxr-xr-xsrc/gtimelog/gtimelog.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gtimelog/gtimelog.py b/src/gtimelog/gtimelog.py
index 38c9d66..cd72afe 100755
--- a/src/gtimelog/gtimelog.py
+++ b/src/gtimelog/gtimelog.py
@@ -776,6 +776,7 @@ class GtkPasswordRequest (urllib2.HTTPPasswordMgr):
username = None
password = None
+ save_to_keyring = False
# try to use GNOME Keyring if available
try:
@@ -806,9 +807,13 @@ class GtkPasswordRequest (urllib2.HTTPPasswordMgr):
None, # authtype
port) # port
except gnomekeyring.NoMatchError:
- pass
+ gnomekeyring = None
except gnomekeyring.NoKeyringDaemonError:
- pass
+ gnomekeyring = None
+ except IOError:
+ gnomekeyring = None
+ except gnomekeyring.IOError: # thanks, gnomekeyring python binding maker
+ gnomekeyring = None
else:
l = l[-1] # take the last key (Why?)
username = l['user']
@@ -882,6 +887,8 @@ class GtkPasswordRequest (urllib2.HTTPPasswordMgr):
password) # password
except gnomekeyring.NoKeyringDaemonError:
pass
+ except gnomekeyring.IOError:
+ pass
gtk.gdk.threads_leave()
return (username, password)