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
Branches
Tags
No related merge requests found
...@@ -31,7 +31,7 @@ class OstOptionParser(optparse.OptionParser): ...@@ -31,7 +31,7 @@ class OstOptionParser(optparse.OptionParser):
def __init__(self, **kwargs): def __init__(self, **kwargs):
optparse.OptionParser.__init__(self, **kwargs) optparse.OptionParser.__init__(self, **kwargs)
def exit(self, status_code, error_message): def exit(self, status_code, error_message):
print error_message, print(error_message, end=' ')
sys.exit(-1) sys.exit(-1)
parser=OstOptionParser(usage=usage,conflict_handler="resolve", prog='ost''') parser=OstOptionParser(usage=usage,conflict_handler="resolve", prog='ost''')
...@@ -74,8 +74,8 @@ _ostrc=os.path.join(home, '.ostrc') ...@@ -74,8 +74,8 @@ _ostrc=os.path.join(home, '.ostrc')
if os.path.exists(_ostrc): if os.path.exists(_ostrc):
try: try:
exec(open(_ostrc)) exec(open(_ostrc))
except Exception, e: except Exception as e:
print e print(e)
PushVerbosityLevel(options.vlevel) PushVerbosityLevel(options.vlevel)
# this should probably only be added when running an interactive shell # this should probably only be added when running an interactive shell
...@@ -86,7 +86,7 @@ if len(parser.rargs)>0 : ...@@ -86,7 +86,7 @@ if len(parser.rargs)>0 :
sys_argv_backup=sys.argv sys_argv_backup=sys.argv
sys.argv=parser.rargs sys.argv=parser.rargs
try: try:
execfile(script) exec(compile(open(script).read(), script, 'exec'))
finally: finally:
sys.argv=sys_argv_backup sys.argv=sys_argv_backup
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment