summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2Py3k.py
blob: 0f5321a41c0fd5f83d79e72777a1589689c3804a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
try:
    from email.Utils import formatdate
except ImportError:
    from email.utils import formatdate

# urllib imports
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
except ImportError:
    from io import StringIO

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