954,549 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FYI py2exe not raising AssertionErrors

Just wanted to point out for anyone using py2exe that it apparently doesn't always (or maybe ever) raise AssertionErrors. It's been a while since they've updated the program so it's probably just easier to implement a workaround for those of us who use this compiler. I've noticed it not raising the error in a variety of circumstances. Here's the workaround I implemented.

python 2.7.2
py2exe 0.6.9

def _assert(assertion):
   # workaround for py2exe not
   # raising assertion errors
   if not assertion:
      raise AssertionError


ps please don't lecture me on why I shouldn't use assert

ihatehippies
Junior Poster
190 posts since Oct 2008
Reputation Points: 33
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: