From 31119a48d469e9f5ee7a07403526586c6d6a8e12 Mon Sep 17 00:00:00 2001 From: Jon Riehl Date: Wed, 5 Jun 2013 13:48:30 -0500 Subject: [PATCH] Modified main routine in llpython.addr_flow to make it easier to determine which code object caused an exception in the translator. --- llpython/addr_flow.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llpython/addr_flow.py b/llpython/addr_flow.py index 8630a5a..26213e8 100644 --- a/llpython/addr_flow.py +++ b/llpython/addr_flow.py @@ -110,11 +110,10 @@ def main(*args): with open(arg) as in_file: in_source = in_file.read() in_codeobj = compile(in_source, arg, 'exec') - flow_map = build_addr_flows_from_co(in_codeobj) - for codeobj, flow in flow_map.items(): + for codeobj in itercodeobjs(in_codeobj): print("_" * 70) print(codeobj) - pprint.pprint(flow) + pprint.pprint(build_addr_flow_from_co(codeobj)) else: pprint.pprint(build_addr_flow(getattr(llfuncs, arg)))