summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2013-06-11 13:42:25 +0530
committerChirayu Desai <cdesai@cyanogenmod.org>2013-06-11 08:21:10 +0000
commitdb2ad9dfce438dae14fed0a62b37f0028ee98ad1 (patch)
tree6f2dc2aef2456c75759cfe9c845a9d4064ff8bc3
parentef668c92c2c87c45df02bf1609a89e4479bbb30c (diff)
downloadgit-repo-db2ad9dfce438dae14fed0a62b37f0028ee98ad1.tar.gz
Fix urllib.parse (urlparse) handling
Revert "Fix "'module' object is not callable" error", and fix it properly. * The urlparse module is renamed to urllib.parse in Python 3. * This commit fixes the code to use "urllib.parse.urlparse" instead of creating a new module urlib and setting urlib.parse to urlparse.urlparse. * Fixes an AttributeError: 'function' object has no attribute 'uses_relative' This reverts commit cd51f17c643370e6199216462c1be36f04d57291. Change-Id: I48490b20ecd19cf5a6edd835506ea5a467d556ac
-rw-r--r--manifest_xml.py2
-rw-r--r--subcmds/sync.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index b6f75477..817a1c80 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -27,7 +27,7 @@ else:
27 import imp 27 import imp
28 import urlparse 28 import urlparse
29 urllib = imp.new_module('urllib') 29 urllib = imp.new_module('urllib')
30 urllib.parse = urlparse.urlparse 30 urllib.parse = urlparse
31 31
32from git_config import GitConfig 32from git_config import GitConfig
33from git_refs import R_HEADS, HEAD 33from git_refs import R_HEADS, HEAD
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 930211c1..c7f02b35 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -34,7 +34,7 @@ else:
34 import urlparse 34 import urlparse
35 import xmlrpclib 35 import xmlrpclib
36 urllib = imp.new_module('urllib') 36 urllib = imp.new_module('urllib')
37 urllib.parse = urlparse.urlparse 37 urllib.parse = urlparse
38 xmlrpc = imp.new_module('xmlrpc') 38 xmlrpc = imp.new_module('xmlrpc')
39 xmlrpc.client = xmlrpclib 39 xmlrpc.client = xmlrpclib
40 40
@@ -509,7 +509,7 @@ later is required to fix a server side protocol bug.
509 file=sys.stderr) 509 file=sys.stderr)
510 else: 510 else:
511 try: 511 try:
512 parse_result = urllib.parse(manifest_server) 512 parse_result = urllib.parse.urlparse(manifest_server)
513 if parse_result.hostname: 513 if parse_result.hostname:
514 username, _account, password = \ 514 username, _account, password = \
515 info.authenticators(parse_result.hostname) 515 info.authenticators(parse_result.hostname)