summaryrefslogtreecommitdiff
path: root/tools/debug-debug-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debug-debug-scripts')
-rwxr-xr-xtools/debug-debug-scripts9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/debug-debug-scripts b/tools/debug-debug-scripts
index 2112a6e..5ba7ecb 100755
--- a/tools/debug-debug-scripts
+++ b/tools/debug-debug-scripts
@@ -1,6 +1,5 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# encoding: utf-8
-from __future__ import print_function
copyright = '''
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -35,6 +34,12 @@ error = False
def eprint(s):
print('Error:', s, file=sys.stderr)
+# Implement an equivalent to Python 2's execfile for Python 3
+def execfile(filename, globals=None, locals=None):
+ with open(filename, 'r') as f:
+ code = compile(f.read(), filename, 'exec')
+ exec(code, globals, locals)
+
def get_classes_from_file(a):
global error
d = {}