Skip to content

Commit

Permalink
new legacy support for constant values
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Nov 12, 2014
1 parent 0941e14 commit f23a87d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/quorum/legacy.py
Expand Up @@ -49,6 +49,11 @@
except ImportError: urllib2 = None
finally: sys.path.insert(0, root)

root = sys.path.pop(0)
try: import httplib
except ImportError: httplib = None
finally: sys.path.insert(0, root)

root = sys.path.pop(0)
try: import urllib.error
except ImportError: urllib.error = None
Expand All @@ -59,6 +64,11 @@
except ImportError: urllib.request = None
finally: sys.path.insert(0, root)

root = sys.path.pop(0)
try: import urllib.client
except ImportError: urllib.client = None
finally: sys.path.insert(0, root)

try: import HTMLParser
except ImportError: import html.parser; HTMLParser = html.parser

Expand Down Expand Up @@ -113,6 +123,12 @@
if PYTHON_3: HTTPError = urllib.error.HTTPError
else: HTTPError = urllib2.HTTPError

if PYTHON_3: HTTPConnection = urllib.client.HTTPConnection
else: HTTPConnection = httplib.HTTPConnection

if PYTHON_3: HTTPSConnection = urllib.client.HTTPSConnection
else: HTTPSConnection = httplib.HTTPSConnection

try: _execfile = execfile #@UndefinedVariable
except: _execfile = None

Expand Down

0 comments on commit f23a87d

Please sign in to comment.