diff options
author | Christoph Mathys <eraserix@gmail.com> | 2013-10-04 18:34:26 +0200 |
---|---|---|
committer | Andrej Shadura <andrewsh@debian.org> | 2018-10-04 21:01:29 +0200 |
commit | 4138308e15fba1ced26b237b8d5800ca2b83c8d4 (patch) | |
tree | c425c90ac6dfbd2c3b6387438ba2fbdbc1d7b088 /mercurial_keyring.py | |
parent | 36d4a4942e391671e747f57cfaf17da644b7e906 (diff) | |
parent | db5079a6b8e4d208efedc514b914ec3964501be2 (diff) |
Import Debian changes 0.6.1-1
mercurial-keyring (0.6.1-1) unstable; urgency=low
* New upstream release.
Diffstat (limited to 'mercurial_keyring.py')
-rw-r--r-- | mercurial_keyring.py | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/mercurial_keyring.py b/mercurial_keyring.py index 3143b04..8f42d9b 100644 --- a/mercurial_keyring.py +++ b/mercurial_keyring.py @@ -46,19 +46,44 @@ except: from mercurial import mail from urllib2 import AbstractBasicAuthHandler, AbstractDigestAuthHandler -# mercurial.demandimport incompatibility workaround, -# would cause gnomekeyring, one of the possible -# keyring backends, not to work. -from mercurial.demandimport import ignore -if "gobject._gobject" not in ignore: - ignore.append("gobject._gobject") - ignore.append("configparser") - ignore.append("json") - ignore.append("abc") - ignore.append("io") - ignore.append("keyring") - -import keyring +# mercurial.demandimport incompatibility workaround. +# various keyring backends fail as they can't properly import helper +# modules (as demandimport modifies python import behaviour). +# If you get import errors with demandimport in backtrace, try +# guessing what to block and extending the list below. +from mercurial import demandimport +for blocked_module in [ + "gobject._gobject", + "configparser", + "json", + "abc", + "io", + "keyring", + "gdata.docs.service", + "gdata.service", + "types", + "atom.http", + "atom.http_interface", + "atom.service", + "atom.token_store", + "ctypes", + "secretstorage.exceptions", + "fs.opener", + ]: + if blocked_module not in demandimport.ignore: + demandimport.ignore.append(blocked_module) + +# Temporarily disable demandimport to make the need of extending +# the list above less likely. +if __import__ == demandimport._import: + demandimport.disable() + try: + import keyring + finally: + demandimport.enable() +else: + import keyring + from urlparse import urlparse import urllib2 import smtplib, socket |