From d2829259a5eac1a7a6b1c71ce484f9b25086d701 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 18 Aug 2016 00:15:40 +0100 Subject: [PATCH] Python 3 compatible first stage. --- econtext/master.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/econtext/master.py b/econtext/master.py index db8fcd6b..9e82b977 100644 --- a/econtext/master.py +++ b/econtext/master.py @@ -244,7 +244,7 @@ class LocalStream(econtext.core.Stream): os.execv(sys.executable,('econtext:'+CONTEXT_NAME,)) else: os.fdopen(W,'wb',0).write(zlib.decompress(sys.stdin.read(input()))) - print 'OK' + print('OK') sys.exit(0) def get_boot_command(self): @@ -259,7 +259,7 @@ class LocalStream(econtext.core.Stream): source = source.replace('CONTEXT_NAME', repr(name)) encoded = source.encode('base64').replace('\n', '') return [self.python_path, '-c', - 'exec "%s".decode("base64")' % (encoded,)] + 'import codecs;exec(codecs.decode("%s","base64"))' % (encoded,)] def __repr__(self): return '%s(%s)' % (self.__class__.__name__, self._context)