From d97e392e9c3c7b0a402e1573190e4eed25ff067e Mon Sep 17 00:00:00 2001
From: Luc Papeleux <L.Papeleux@ULiege.be>
Date: Thu, 25 Jun 2020 11:44:38 +0200
Subject: [PATCH] Py3 port suite

---
 launch.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/launch.py b/launch.py
index 2a7641d..9d75e04 100755
--- a/launch.py
+++ b/launch.py
@@ -339,16 +339,17 @@ class LaunchJob(ParametricJob):
         # filling command to battery
         pin.write('import sys, os, os.path\n')
         if self.debug:
-            pin.write('print ("sys.path = ", sys.path\n)')
-            pin.write('print ("os.getcwd() = ", os.getcwd()\n)')
+            pin.write('print ("sys.path = ", sys.path)\n')
+            pin.write('print ("os.getcwd() = ", os.getcwd())\n')
         #pin.write("raw_input()\n")
         pin.write('if os.path.isdir(r"%s"):\n'%mtfdir)
         pin.write('\tsys.path.append(r"%s")\n'%mtfdir) # mtfdir est dorenavant un abspath
         #pin.write('\tsys.path.append(os.path.abspath(r"%s"))\n'%mtfdir)
         pin.write('else:\n')
-        pin.write('\tprint ("metafor dir %s not found!"\n)'%mtfdir)
+        pin.write('\tprint ("metafor dir %s not found!")\n'%mtfdir)
         pin.write('\tsys.exit()\n\n')
-        pin.write('execfile(r"%s")\n'%os.path.join(mtfdir,'.pythonrc.py'))
+        pin.write('exec(open(r"%s").read())\n'%os.path.join(mtfdir,'.pythonrc.py'))
+        #pin.write('execfile(r"%s")\n'%os.path.join(mtfdir,'.pythonrc.py'))
         pin.write('import toolbox.battery as b\n')
         pin.write('battery = b.Battery() \n')
         pin.write('battery.keepFacs = True\n')
-- 
GitLab