Skip to content

Commit

Permalink
Merge pull request #3952 from t20100/cleanup-python2-support
Browse files Browse the repository at this point in the history
tools: Clean-up Python2 support code
  • Loading branch information
vallsv authored Oct 24, 2023
2 parents a865634 + 350a304 commit 6616e3e
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ def _get_available_scripts(path):
return res


if sys.version_info[0] >= 3: # Python3

def execfile(fullpath, globals=None, locals=None):
"Python3 implementation for execfile"
with open(fullpath) as f:
try:
data = f.read()
except UnicodeDecodeError:
raise SyntaxError("Not a Python script")
code = compile(data, fullpath, 'exec')
exec(code, globals, locals)
def execfile(fullpath, globals=None, locals=None):
"Python3 implementation for execfile"
with open(fullpath) as f:
try:
data = f.read()
except UnicodeDecodeError:
raise SyntaxError("Not a Python script")
code = compile(data, fullpath, 'exec')
exec(code, globals, locals)


def run_file(filename, argv):
Expand Down

0 comments on commit 6616e3e

Please sign in to comment.