Hi again,

Continuing my tests, I've seen something strange concerning the 
__debug__ variable in generated executables when using the optimize 
flags. Here is the problem: I have a very simple script:
--test.py--------------------------
print __debug__
assert False
-------------------------------------

Interactively, it does what's expected:
$ python test.py
True
Traceback (most recent call last):
   File "test.py", line 2, in <module>
     assert False
AssertionError

$ python -O test.py
False

If built without any -O option, the result is the same as running it 
interactively without the -O option. The surprise is when I build it 
with -O1. The result is:
$ ./test
True

So it seems the assert is actually removed from the final code, but 
the __debug__ variable stays True. How is this possible?
-- 
- Eric Brunel



------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
cx-freeze-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cx-freeze-users

Reply via email to