weimingtom / tinypy

Automatically exported from code.google.com/p/tinypy
Other
1 stars 0 forks source link

bytecode may be garbage collected during execution of code #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Add this to tests.py:

    #test that the __main__ module doesn't get GC'd
    t_render("""
MODULES["__main__"] = None
for n in range(0,50000):
    x = [n]
print("OK")
""","OK")

What is the expected output? What do you see instead?

It should say "OK" instead it gives some sort of error message.  For example: 

Exception:
tp_step: invalid instruction 105'

This is because since the main reference to the __main__ module has been
removed, the module gets garbage collected while it is being used.  

Original issue reported on code.google.com by philhas...@gmail.com on 5 Sep 2008 at 6:30

GoogleCodeExporter commented 9 years ago

Original comment by philhas...@gmail.com on 14 Sep 2008 at 3:35