core: remove pointless eval() of ARGV0 environment variable.

wip-fakessh-exit-status
David Wilson 7 years ago
parent 1411790f56
commit a9387b0504

@ -657,6 +657,7 @@ class Stream(BasicStream):
LOG.debug('%r.on_shutdown(%r)', self, broker)
def accept(self, rfd, wfd):
# TODO: what is this os.dup for?
self.receive_side = Side(self, os.dup(rfd))
self.transmit_side = Side(self, os.dup(wfd))
set_cloexec(self.receive_side.fd)
@ -1184,7 +1185,7 @@ class ExternalContext(object):
self.router.register(self.parent, self.stream)
sys.executable, = eval(os.environ.pop('ARGV0'))
sys.executable = os.environ.pop('ARGV0', sys.executable)
LOG.debug('Connected to %s; my ID is %r, PID is %r',
self.parent, context_id, os.getpid())
LOG.debug('Recovered sys.executable: %r', sys.executable)

@ -384,7 +384,7 @@ def run(dest, router, args, deadline=None, econtext=None):
env = os.environ.copy()
env.update({
'PATH': '%s:%s' % (tmp_path, env.get('PATH', '')),
'ARGV0': `[sys.executable]`,
'ARGV0': sys.executable,
'SSH_PATH': ssh_path,
})

@ -588,7 +588,7 @@ class Stream(mitogen.core.Stream):
os.dup2(R,0)
os.dup2(R2,101)
for f in R,R2,W,W2: os.close(f)
os.environ['ARGV0'] = `[sys.executable]`
os.environ['ARGV0'] = sys.executable
os.execv(sys.executable,['mitogen:CONTEXT_NAME'])
else:
os.write(1, 'EC0\n')

Loading…
Cancel
Save