From 00ebde86d16f384a92cb498eb535fbd06d063ca6 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Fri, 15 Nov 2019 11:05:15 +0100 Subject: [PATCH] Fix ost startup scripts execfile has been replaced by exec in Python 3 --- scripts/ost.in | 4 ++-- scripts/ost_startup.py.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ost.in b/scripts/ost.in index a20bef97b..6da63bda4 100755 --- a/scripts/ost.in +++ b/scripts/ost.in @@ -47,7 +47,7 @@ if test -e "${OST_SCRIPT}" ; then fi done IFS="#" - $pyexec -c "execfile('$DNG_ROOT/@LIBDIR@/python@PYTHON_VERSION@/site-packages/ost/ost_startup.py')" "${OST_SCRIPT}" $opts + $pyexec -c "exec(open('$DNG_ROOT/@LIBDIR@/python@PYTHON_VERSION@/site-packages/ost/ost_startup.py').read())" "${OST_SCRIPT}" $opts RC=$? else opts="" @@ -59,7 +59,7 @@ else fi done IFS="#" - $pyexec $interactive -c "execfile('$DNG_ROOT/@LIBDIR@/python@PYTHON_VERSION@/site-packages/ost/ost_startup.py')" $opts + $pyexec $interactive -c "exec(open('$DNG_ROOT/@LIBDIR@/python@PYTHON_VERSION@/site-packages/ost/ost_startup.py').read())" $opts RC=$? fi IFS=$OLDIFS diff --git a/scripts/ost_startup.py.in b/scripts/ost_startup.py.in index ed156415b..6a5addab2 100644 --- a/scripts/ost_startup.py.in +++ b/scripts/ost_startup.py.in @@ -73,7 +73,7 @@ home = os.getenv('HOME') or os.getenv('USERPROFILE') _ostrc=os.path.join(home, '.ostrc') if os.path.exists(_ostrc): try: - exec(open(_ostrc)) + exec(compile(open(_ostrc).read(), _ostrc, 'exec')) except Exception as e: print(e) PushVerbosityLevel(options.vlevel) -- GitLab