Loading...
--- dyld/dyld-1042.1/testing/kernel-cache-tests/testall.py
+++ dyld/dyld-960/testing/kernel-cache-tests/testall.py
@@ -1,11 +1,10 @@
-#!/usr/bin/python3
+#!/usr/bin/python2.7
import string
import os
import json
import sys
-import importlib
-import importlib.machinery
+import imp
import os.path
import traceback
@@ -26,23 +25,23 @@
for f in all_tests:
test_case = test_dir + "/" + f + "/test.py"
if os.path.isfile(test_case):
- py_mod = importlib.machinery.SourceFileLoader(f, test_case).load_module()
+ py_mod = imp.load_source(f, test_case)
check_func = getattr(py_mod, "check", 0)
if check_func == 0:
- print("FAIL: " + f + ", missing check() function")
+ print "FAIL: " + f + ", missing check() function";
else:
try:
kernelCollection = KernelCollection.KernelCollection(test_to_run != "")
check_func(kernelCollection)
- print("PASS: " + f)
- except AssertionError:
+ print "PASS: " + f
+ except AssertionError, e:
_, _, tb = sys.exc_info()
tb_info = traceback.extract_tb(tb)
filename, line, func, text = tb_info[-1]
- print("FAIL: " + f + ", " + text)
- except KeyError:
+ print "FAIL: " + f + ", " + text
+ except KeyError, e:
_, _, tb = sys.exc_info()
tb_info = traceback.extract_tb(tb)
filename, line, func, text = tb_info[-1]
- print("FAIL: " + f + ", " + text)
+ print "FAIL: " + f + ", " + text