Mercurial > hg
comparison mercurial/pycompat.py @ 29431:80880ad3fccd
py3: conditionalize the urlparse import
The urlparse library is renamed to urllib.parse in python 3
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 27 Jun 2016 16:16:10 +0530 |
parents | 2646fbba4ca7 |
children | 34b914ac573e |
comparison
equal
deleted
inserted
replaced
29430:72065b3b90a4 | 29431:80880ad3fccd |
---|---|
14 import cPickle as pickle | 14 import cPickle as pickle |
15 pickle.dumps | 15 pickle.dumps |
16 except ImportError: | 16 except ImportError: |
17 import pickle | 17 import pickle |
18 pickle.dumps # silence pyflakes | 18 pickle.dumps # silence pyflakes |
19 | |
20 try: | |
21 import urlparse | |
22 urlparse.urlparse | |
23 except ImportError: | |
24 import urllib.parse as urlparse | |
25 urlparse.urlparse | |
19 | 26 |
20 try: | 27 try: |
21 import cStringIO as io | 28 import cStringIO as io |
22 stringio = io.StringIO | 29 stringio = io.StringIO |
23 except ImportError: | 30 except ImportError: |