diff mercurial/pycompat.py @ 29432:34b914ac573e

py3: conditionalize xmlrpclib import The xmlrpclib library is renamed to xmlrpc.client in python 3
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 27 Jun 2016 16:37:37 +0530
parents 80880ad3fccd
children 33770d2b6cf9
line wrap: on
line diff
--- a/mercurial/pycompat.py	Mon Jun 27 16:16:10 2016 +0530
+++ b/mercurial/pycompat.py	Mon Jun 27 16:37:37 2016 +0530
@@ -18,6 +18,13 @@
     pickle.dumps # silence pyflakes
 
 try:
+    import xmlrpclib
+    xmlrpclib.Transport
+except ImportError:
+    import xmlrpc.client as xmlrpclib
+    xmlrpclib.Transport
+
+try:
     import urlparse
     urlparse.urlparse
 except ImportError: