]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.2/Tools/compiler/stacktest.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.2 / Tools / compiler / stacktest.py
diff --git a/AppPkg/Applications/Python/Python-2.7.2/Tools/compiler/stacktest.py b/AppPkg/Applications/Python/Python-2.7.2/Tools/compiler/stacktest.py
deleted file mode 100644 (file)
index 986cd13..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-import compiler\r
-import dis\r
-import types\r
-\r
-def extract_code_objects(co):\r
-    l = [co]\r
-    for const in co.co_consts:\r
-        if type(const) == types.CodeType:\r
-            l.append(const)\r
-    return l\r
-\r
-def compare(a, b):\r
-    if not (a.co_name == "?" or a.co_name.startswith('<lambda')):\r
-        assert a.co_name == b.co_name, (a, b)\r
-    if a.co_stacksize != b.co_stacksize:\r
-        print "stack mismatch %s: %d vs. %d" % (a.co_name,\r
-                                                a.co_stacksize,\r
-                                                b.co_stacksize)\r
-        if a.co_stacksize > b.co_stacksize:\r
-            print "good code"\r
-            dis.dis(a)\r
-            print "bad code"\r
-            dis.dis(b)\r
-            assert 0\r
-\r
-def main(files):\r
-    for file in files:\r
-        print file\r
-        buf = open(file).read()\r
-        try:\r
-            co1 = compile(buf, file, "exec")\r
-        except SyntaxError:\r
-            print "skipped"\r
-            continue\r
-        co2 = compiler.compile(buf, file, "exec")\r
-        co1l = extract_code_objects(co1)\r
-        co2l = extract_code_objects(co2)\r
-        for a, b in zip(co1l, co2l):\r
-            compare(a, b)\r
-\r
-if __name__ == "__main__":\r
-    import sys\r
-    main(sys.argv[1:])\r