diff options
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 8fb94885..b34787d2 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -24,22 +24,17 @@ import socket | |||
24 | import subprocess | 24 | import subprocess |
25 | import sys | 25 | import sys |
26 | import time | 26 | import time |
27 | try: | 27 | |
28 | # For python3 | 28 | from pyversion import is_python3 |
29 | if is_python3(): | ||
29 | import urllib.parse | 30 | import urllib.parse |
30 | except ImportError: | 31 | import xmlrpc.client |
31 | # For python2 | 32 | else: |
32 | import imp | 33 | import imp |
33 | import urlparse | 34 | import urlparse |
35 | import xmlrpclib | ||
34 | urllib = imp.new_module('urllib') | 36 | urllib = imp.new_module('urllib') |
35 | urllib.parse = urlparse | 37 | urllib.parse = urlparse |
36 | try: | ||
37 | # For python3 | ||
38 | import xmlrpc.client | ||
39 | except ImportError: | ||
40 | # For python2 | ||
41 | import imp | ||
42 | import xmlrpclib | ||
43 | xmlrpc = imp.new_module('xmlrpc') | 38 | xmlrpc = imp.new_module('xmlrpc') |
44 | xmlrpc.client = xmlrpclib | 39 | xmlrpc.client = xmlrpclib |
45 | 40 | ||