Sync: Don't fail when git cookies can't be loaded

If the git cookies file fails to load, use a default
cookie jar instead.

Bug: Issue 207
Change-Id: I7cb326c204f2784ab4dbd13801b3186667af5b78
This commit is contained in:
David Pursehouse 2015-09-30 10:35:43 +09:00
parent f231db11a2
commit b1ad2190a2

View File

@ -925,7 +925,10 @@ class PersistentTransport(xmlrpc.client.Transport):
tmpcookiefile.flush()
cookiejar = cookielib.MozillaCookieJar(tmpcookiefile.name)
cookiejar.load()
try:
cookiejar.load()
except cookielib.LoadError:
cookiejar = cookielib.CookieJar()
finally:
tmpcookiefile.close()
else: