From 8643e3cba4f229faba5d1aeb9a7b31ba609f81fb Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Sun, 17 Feb 2019 20:43:28 +0100 Subject: [PATCH] Convert YAPTU to Python3. It should now work with python2 and python3. --- scripts/yaptu.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/yaptu.py b/scripts/yaptu.py index ddf18f50..cffb1905 100644 --- a/scripts/yaptu.py +++ b/scripts/yaptu.py @@ -33,7 +33,7 @@ class copier: def repl(match, self=self): "return the eval of a found expression, for replacement" # uncomment for debug: - # print '!!! replacing',match.group(1) + # print '!!! replacing',match.group(1) expr = self.preproc(match.group(1), 'eval') try: return str(eval(expr, self.globals, self.locals)) except: return str(self.handle(expr)) @@ -65,8 +65,8 @@ class copier: stat = self.preproc(stat, 'exec') stat = '%s _cb(%s,%s)' % (stat,i+1,j) # for debugging, uncomment...: - # print "-> Executing: {"+stat+"}" - exec stat in self.globals,self.locals + # print "-> Executing: {"+stat+"}" + exec(stat, self.globals, self.locals) i=j+1 else: # normal line, just copy with substitution self.ouf.write(self.regex.sub(repl,line)) -- 2.44.0