Permalink
Browse files

testing for __main__

  • Loading branch information...
1 parent 4759926 commit 6154919e982a5e495fd0db7cc00503a23da7aec9 @leovt committed Feb 26, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 interp.py
View
5 interp.py
@@ -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.