summaryrefslogtreecommitdiffstats
path: root/subcmds
diff options
context:
space:
mode:
Diffstat (limited to 'subcmds')
-rw-r--r--subcmds/forall.py4
-rw-r--r--subcmds/init.py4
2 files changed, 5 insertions, 3 deletions
diff --git a/subcmds/forall.py b/subcmds/forall.py
index 6a6d30c9..ebc8beca 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -278,7 +278,9 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
278 def setenv(name, val): 278 def setenv(name, val):
279 if val is None: 279 if val is None:
280 val = '' 280 val = ''
281 env[name] = val.encode() 281 if hasattr(val, 'encode'):
282 val = val.encode()
283 env[name] = val
282 284
283 setenv('REPO_PROJECT', project['name']) 285 setenv('REPO_PROJECT', project['name'])
284 setenv('REPO_PATH', project['relpath']) 286 setenv('REPO_PATH', project['relpath'])
diff --git a/subcmds/init.py b/subcmds/init.py
index b73de71c..dbb6ddda 100644
--- a/subcmds/init.py
+++ b/subcmds/init.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 color import Coloring 32from color import Coloring
33from command import InteractiveCommand, MirrorSafeCommand 33from command import InteractiveCommand, MirrorSafeCommand
@@ -153,7 +153,7 @@ to update the working directory files.
153 # server where this git is located, so let's save that here. 153 # server where this git is located, so let's save that here.
154 mirrored_manifest_git = None 154 mirrored_manifest_git = None
155 if opt.reference: 155 if opt.reference:
156 manifest_git_path = urllib.parse(opt.manifest_url).path[1:] 156 manifest_git_path = urllib.parse.urlparse(opt.manifest_url).path[1:]
157 mirrored_manifest_git = os.path.join(opt.reference, manifest_git_path) 157 mirrored_manifest_git = os.path.join(opt.reference, manifest_git_path)
158 if not mirrored_manifest_git.endswith(".git"): 158 if not mirrored_manifest_git.endswith(".git"):
159 mirrored_manifest_git += ".git" 159 mirrored_manifest_git += ".git"