tools: Update verify_decompile to force-optimize the Python bytecode, if possible.

This commit is contained in:
Sam Edwards 2013-09-28 10:39:22 -06:00
parent 85d3ae15b9
commit fc56183b84

View file

@ -41,6 +41,8 @@ def find_code(to_search):
yield to_search yield to_search
def compare_code(c1, c2): def compare_code(c1, c2):
if hasattr(c1, 'force_optimize'): c1 = c1.force_optimize()
if hasattr(c2, 'force_optimize'): c2 = c2.force_optimize()
if c1.co_name != c2.co_name: if c1.co_name != c2.co_name:
print "co_name mismatch" print "co_name mismatch"
print "Expected: ", c1.co_name print "Expected: ", c1.co_name