[Python-Dev] addressing distutils inability to track file dependencies

Tim Peters tim.one@comcast.net
Fri, 14 Jun 2002 11:18:22 -0400


[Thomas Heller]
> ...
> I don't know if it even is possible (in Python code) to determine
> whether the debug or the release exe is currently running.

FYI, the sys module exposes some debugging tools only in the debug build.
So, e.g.,

def is_debug_build():
    import sys
    return hasattr(sys, "getobjects")

returns the right answer (and, I believe, under all versions of Python).