summaryrefslogtreecommitdiff
path: root/tools/debug-debug-scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/debug-debug-scripts')
-rwxr-xr-xtools/debug-debug-scripts8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/debug-debug-scripts b/tools/debug-debug-scripts
index 2112a6e..cfdc31f 100755
--- a/tools/debug-debug-scripts
+++ b/tools/debug-debug-scripts
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
# encoding: utf-8
from __future__ import print_function
@@ -35,6 +35,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 = {}