Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: third_party/upload.py

Issue 7715013: Update upload.py from rietveld @ 7696eca367d2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698