Changeset: f6da384417c2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f6da384417c2
Modified Files:
        testing/Mtest.py.in
Branch: Aug2018
Log Message:

Reset PYTHONPATH.


diffs (38 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2994,6 +2994,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                 Srvr.extend(['--set', 'embedded_r=yes'])
 
             savepath = None
+            savepypath = None
             if (COND != None and "HAVE_LIBPY3" in COND) and 
CONDITIONALS['HAVE_LIBPY3']:
                 # enable Python 3 integration in server
                 if winreg is not None:
@@ -3001,6 +3002,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                         with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 
r'SOFTWARE\Python\PythonCore\3.7\InstallPath') as key:
                             instpath = winreg.QueryValue(key, None)
                             os.environ['PYTHONHOME'] = instpath
+                            savepypath = os.environ.get('PYTHONPATH')
                             os.environ['PYTHONPATH'] = instpath + 'Lib'
                             savepath = os.environ['PATH']
                             os.environ['PATH'] = instpath.rstrip('\\') + 
os.pathsep + savepath
@@ -3014,6 +3016,7 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                         with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, 
r'SOFTWARE\Python\PythonCore\2.7\InstallPath') as key:
                             instpath = winreg.QueryValue(key, None)
                             os.environ['PYTHONHOME'] = instpath
+                            savepypath = os.environ.get('PYTHONPATH')
                             os.environ['PYTHONPATH'] = instpath + 'Lib'
                             savepath = os.environ['PATH']
                             os.environ['PATH'] = instpath.rstrip('\\') + 
os.pathsep + savepath
@@ -3028,6 +3031,10 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
             pSrvr, pSrvrTimer = LaunchIt(Srvr, 
'\nio.printf("\\nReady.\\n");\n', SrvrOut, SrvrErr, TIMEOUT)
             if savepath is not None:
                 os.environ['PATH'] = savepath
+                if savepypath:
+                    os.environ['PYTHONPATH'] = savepypath
+                else:
+                    del os.environ['PYTHONPATH']
             ln="dummy"
             while 0 < len(ln) and not ln.startswith('Ready.'):
                 ln=pSrvr.stdout.readline()
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to