Chromium Code Reviews| Index: third_party/upload.py |
| diff --git a/third_party/upload.py b/third_party/upload.py |
| index 53c2c93656f67abf3e37f23d37920ba92e2893d4..8b7268a7c4db44f091f19ecbe60ecf4917c030b4 100755 |
| --- a/third_party/upload.py |
| +++ b/third_party/upload.py |
| @@ -612,12 +612,19 @@ def GetRpcServer(server, email=None, host_override=None, save_cookies=True, |
| """Prompts the user for a username and password.""" |
| # Create a local alias to the email variable to avoid Python's crazy |
| # scoping rules. |
| + global keyring |
| local_email = email |
| if local_email is None: |
| local_email = GetEmail("Email (login for uploading to %s)" % server) |
| password = None |
| if keyring: |
| - password = keyring.get_password(host, local_email) |
| + try: |
| + password = keyring.get_password(host, local_email) |
| + except: |
| + # Sadly, we have to trap all errors here as |
| + # gnomekeyring.IOError inherits from object. :/ |
|
Dirk Pranke
2011/08/23 20:13:27
I don't get this; you're saying that you can't che
M-A Ruel
2011/08/23 20:14:36
No, that the keyring module is a leaky abstraction
|
| + print "Failed to get password from keyring" |
| + keyring = None |
| if password is not None: |
| print "Using password from system keyring." |
| else: |