forall: setenv, only encode val if encode exists

Change-Id: I655e3043d0118c4e929897d3a51e5e013e5758dc
This commit is contained in:
Anthony King 2015-06-03 17:29:29 +01:00 committed by David Pursehouse
parent 7993f3cdda
commit c116f94261

View File

@ -278,7 +278,9 @@ def DoWork(project, mirror, opt, cmd, shell, cnt, config):
def setenv(name, val):
if val is None:
val = ''
env[name] = val.encode()
if hasattr(val, 'encode'):
val = val.encode()
env[name] = val
setenv('REPO_PROJECT', project['name'])
setenv('REPO_PATH', project['relpath'])