For what it's worth, if you're dealing with code which relies on assert
to function properly, then adding the following code will ensure that asserts are enabled:
try: assert False raise Exception('Python assertions are not working. This tool relies on Python assertions to do its job. Possible causes are running with the "-O" flag or running a precompiled (".pyo" or ".pyc") module.')except AssertionError: pass