Re: Check in interpreter if running a debug version of python

2010-07-27 Thread Christian Heimes
> Starting with Python 2.7 and 3.2 you can do this: > sysconfig.get_config_var("Py_DEBUG") > 1 > > (returns None if the var doesn't exist) IIRC sysconfig.get_config_var() still depends on parsing the pyconfig.h file. This won't work on Windows because we are using project and config setting

Re: Check in interpreter if running a debug version of python

2010-07-27 Thread Brian Curtin
On Tue, Jul 27, 2010 at 09:06, John Reid wrote: > Can I check in the interpreter if I am running a debug version of python? I > don't mean if __debug__ is set, I want to know if python was compiled in > debug mode. > > Thanks, > John. Starting with Python 2.7 and 3.2 you can do this: >>> syscon

Re: Check in interpreter if running a debug version of python

2010-07-27 Thread Christian Heimes
> Can I check in the interpreter if I am running a debug version of > python? I don't mean if __debug__ is set, I want to know if python was > compiled in debug mode. Python has multiple flavors of debug builds. hasattr(sys, "gettotalrefcount") is only available if Py_REF_DEBUG is enabled. This

Check in interpreter if running a debug version of python

2010-07-27 Thread John Reid
Can I check in the interpreter if I am running a debug version of python? I don't mean if __debug__ is set, I want to know if python was compiled in debug mode. Thanks, John. -- http://mail.python.org/mailman/listinfo/python-list