Skip to content
Snippets Groups Projects
Commit 70c2e161 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

Apply 2to3 to file not ending with .py

Executed command: 2to3-2.7 -n -w scripts/ost_startup.py.in
parent 6e60b71d
No related branches found
No related tags found
No related merge requests found
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment