2008-06-28 | Paul Boddie | raw annotate files changeset graph | Added exception handler variable definition support to the inspection process. Introduced frame position tracking in order to more accurately track and assign stack element usage, employing special methods to be used around function invocation code generation. Added some support for raise statement code generation. Simplified the remove_op_using_stack method and made more use of the actual stack element information found in StackLoad operations. Introduced a LoadResult instruction. Added a test of simple exception raising and handling. |
1 #!/usr/bin/env python 2 3 import imported 4 5 imported.attr = 456 # detected with warning 6 7 m = imported 8 imported.a = 9 # detected with warning 9 m.a = 8 # detected with warning (m is always imported) 10 11 imported.x = 1 # detected with warning (despite no collision) 12 13 n = None 14 n = imported 15 n.y = 2 # not detected due to reassignment of n 16 n.y = 3 # not detected due to reassignment of n 17 18 # vim: tabstop=4 expandtab shiftwidth=4