From 70c2e161a854c73a13387865a030d575a6cb5034 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Fri, 15 Nov 2019 09:05:05 +0100 Subject: [PATCH] Apply 2to3 to file not ending with .py Executed command: 2to3-2.7 -n -w scripts/ost_startup.py.in --- scripts/ost_startup.py.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ost_startup.py.in b/scripts/ost_startup.py.in index d3cac43d8..ed156415b 100644 --- a/scripts/ost_startup.py.in +++ b/scripts/ost_startup.py.in @@ -31,7 +31,7 @@ class OstOptionParser(optparse.OptionParser): def __init__(self, **kwargs): optparse.OptionParser.__init__(self, **kwargs) def exit(self, status_code, error_message): - print error_message, + print(error_message, end=' ') sys.exit(-1) parser=OstOptionParser(usage=usage,conflict_handler="resolve", prog='ost''') @@ -74,8 +74,8 @@ _ostrc=os.path.join(home, '.ostrc') if os.path.exists(_ostrc): try: exec(open(_ostrc)) - except Exception, e: - print e + except Exception as e: + print(e) PushVerbosityLevel(options.vlevel) # this should probably only be added when running an interactive shell @@ -86,7 +86,7 @@ if len(parser.rargs)>0 : sys_argv_backup=sys.argv sys.argv=parser.rargs try: - execfile(script) + exec(compile(open(script).read(), script, 'exec')) finally: sys.argv=sys_argv_backup -- GitLab