From a73a964e51247ed169d322c725a3a18859f109a3 Mon Sep 17 00:00:00 2001 From: Ori Bernstein Date: Mon, 14 Jun 2021 00:00:37 +0000 Subject: python, hg: tow outside the environment. they've served us well, and can ride off into the sunset. --- sys/src/cmd/python/Tools/compiler/stacktest.py | 43 -------------------------- 1 file changed, 43 deletions(-) delete mode 100644 sys/src/cmd/python/Tools/compiler/stacktest.py (limited to 'sys/src/cmd/python/Tools/compiler/stacktest.py') diff --git a/sys/src/cmd/python/Tools/compiler/stacktest.py b/sys/src/cmd/python/Tools/compiler/stacktest.py deleted file mode 100644 index 4f4b1611c..000000000 --- a/sys/src/cmd/python/Tools/compiler/stacktest.py +++ /dev/null @@ -1,43 +0,0 @@ -import compiler -import dis -import types - -def extract_code_objects(co): - l = [co] - for const in co.co_consts: - if type(const) == types.CodeType: - l.append(const) - return l - -def compare(a, b): - if not (a.co_name == "?" or a.co_name.startswith(' b.co_stacksize: - print "good code" - dis.dis(a) - print "bad code" - dis.dis(b) - assert 0 - -def main(files): - for file in files: - print file - buf = open(file).read() - try: - co1 = compile(buf, file, "exec") - except SyntaxError: - print "skipped" - continue - co2 = compiler.compile(buf, file, "exec") - co1l = extract_code_objects(co1) - co2l = extract_code_objects(co2) - for a, b in zip(co1l, co2l): - compare(a, b) - -if __name__ == "__main__": - import sys - main(sys.argv[1:]) -- cgit v1.2.3