From a8dcd53ccca0d6fffc4568bc216ddedeed610474 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Wed, 18 Oct 2017 00:27:00 +0100 Subject: [PATCH] first stage: Remove/dedent else block Since the above if block ends in a call to os.execv() this block will only ever run when the if condition was false. Hence putting it in an else clause is unnecessary. --- mitogen/master.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mitogen/master.py b/mitogen/master.py index 46a1153c..eb43d832 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -714,13 +714,12 @@ class Stream(mitogen.core.Stream): 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(w,'w',0).write('%s\n'%len(C)+C) - os.write(1,'EC1\n') - sys.exit(0) + os.write(1,'EC0\n') + C=zlib.decompress(sys.stdin.read(input())) + os.fdopen(W,'w',0).write(C) + os.fdopen(w,'w',0).write('%s\n'%len(C)+C) + os.write(1,'EC1\n') + sys.exit(0) def get_boot_command(self): source = inspect.getsource(self._first_stage)