Skip to content

Commit

Permalink
testing for __main__
Browse files Browse the repository at this point in the history
  • Loading branch information
leovt committed Feb 26, 2012
1 parent 4759926 commit 6154919
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions interp.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,9 @@ def execute(code, globals):
else:
raise Exception('Unknown Opcode %d (%s)' % (bc, dis.opname[bc]))

print 'normal Python call:', test()
print 'own execute function:', execute(test.func_code, test.func_globals)
if __name__ == '__main__':
print 'normal Python call:', test()
print 'own execute function:', execute(test.func_code, test.func_globals)



0 comments on commit 6154919

Please sign in to comment.