diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-04-26 15:18:04 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-04-26 15:18:04 -0500 |
commit | bef2d0c73eb0b3fd071f616aa43a945ae2d103b7 (patch) | |
tree | 6b7442075da3d88d649ac9cbe82d6007558e7c8f /src/lib/Bcfg2Py3k.py | |
parent | 944df5470f9d30717baccf7b716fd4847b31da27 (diff) | |
download | bcfg2-bef2d0c73eb0b3fd071f616aa43a945ae2d103b7.tar.gz bcfg2-bef2d0c73eb0b3fd071f616aa43a945ae2d103b7.tar.bz2 bcfg2-bef2d0c73eb0b3fd071f616aa43a945ae2d103b7.zip |
Plugins: Add full PY3K compatibility
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Bcfg2Py3k.py')
-rw-r--r-- | src/lib/Bcfg2Py3k.py | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/lib/Bcfg2Py3k.py b/src/lib/Bcfg2Py3k.py index b334c4466..0f5321a41 100644 --- a/src/lib/Bcfg2Py3k.py +++ b/src/lib/Bcfg2Py3k.py @@ -5,13 +5,21 @@ except ImportError: # urllib imports try: - from urllib import urlopen -except ImportError: - from urllib.request import urlopen -try: from urlparse import urljoin + from urllib2 import HTTPBasicAuthHandler + from urllib2 import HTTPPasswordMgrWithDefaultRealm + from urllib2 import build_opener + from urllib2 import install_opener + from urllib import urlopen + from urllib2 import HTTPError except ImportError: from urllib.parse import urljoin + from urllib.request import HTTPBasicAuthHandler + from urllib.request import HTTPPasswordMgrWithDefaultRealm + from urllib.request import build_opener + from urllib.request import install_opener + from urllib.request import urlopen + from urllib.error import HTTPError try: from cStringIO import StringIO @@ -22,3 +30,17 @@ try: import ConfigParser except ImportError: import configparser as ConfigParser + +try: + import cPickle +except ImportError: + import pickle as cPickle + +try: + from Queue import Queue + from Queue import Empty + from Queue import Full +except ImportError: + from queue import Queue + from queue import Empty + from queue import Full |