# HG changeset patch # User Tuomo Valkonen # Date 1516536264 0 # Node ID 9dd2e5d57a7c7a1e9fec44ac5a666512586de9ee # Parent a7c56424e8678ede088f70d8d8a10ef1b90a3562 Something weird going on diff -r a7c56424e867 -r 9dd2e5d57a7c instance.py --- a/instance.py Sun Jan 21 11:59:53 2018 +0000 +++ b/instance.py Sun Jan 21 12:04:24 2018 +0000 @@ -41,20 +41,19 @@ logging.info('Launching ' + str(cmd)) - env=None + env=os.environ.copy() if passphrase: - env=os.environ.copy() env['BORG_PASSPHRASE']=passphrase # Workaround: if launched is a standalone app created with py2app, # borg will fail unless Python environment is reset. # TODO: Of course, this will fail if the system needs the variables # PYTHONPATH or PYTHONHOME set to certain values. - if '_PY2APP_LAUNCHED_' in env and env['_PY2APP_LAUNCHED_']=='1': - if env==None: - env=os.environ.copy() - del env['PYTHONPATH'] - del env['PYTHONHOME'] + if '_PY2APP_LAUNCHED_' in env: + val=env['_PY2APP_LAUNCHED_'] + if val=='1': + del env['PYTHONPATH'] + del env['PYTHONHOME'] self.proc=Popen(cmd, env=env, stdout=PIPE, stderr=PIPE, stdin=PIPE)