From 9ee1d132705e65dc8734e6981fcc91adb5643fab Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 18 Oct 2017 00:15:15 +0100 Subject: [PATCH] first stage: single letter variables --- mitogen/master.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mitogen/master.py b/mitogen/master.py index 0bdfd60e..ca0251a2 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -706,19 +706,19 @@ class Stream(mitogen.core.Stream): def _first_stage(): import os,sys,zlib R,W=os.pipe() - R2,W2=os.pipe() + r,w=os.pipe() if os.fork(): os.dup2(0,100) os.dup2(R,0) - os.dup2(R2,101) - for f in R,R2,W,W2: os.close(f) - os.environ['ARGV0'] = sys.executable - os.execv(sys.executable,['mitogen:CONTEXT_NAME']) + os.dup2(r,101) + for f in R,r,W,w:os.close(f) + os.environ['ARGV0']=e=sys.executable + os.execv(e,['mitogen:CONTEXT_NAME']) else: os.write(1, 'EC0\n') C = zlib.decompress(sys.stdin.read(input())) os.fdopen(W,'w',0).write(C) - os.fdopen(W2,'w',0).write('%s\n%s' % (len(C),C)) + os.fdopen(w,'w',0).write('%s\n%s'%(len(C),C)) os.write(1, 'EC1\n') sys.exit(0)