This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients alex, berker.peksag, brett.cannon, ezio.melotti, matrixise, serhiy.storchaka, vstinner
Date 2015-10-01.22:33:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1443738806.36.0.807225334682.issue25256@psf.upfronthosting.co.za>
In-reply-to
Content
>> You also can check ``'d' in sys.abiflags`` if it looks cleaner to you.

> For me, it doesn't look correct to have various ways to check if python was compiled in debug mode. It doesn't look portable neither. (...)

Oops, I didn't notice that sys.abiflags is not available on Windows!

It's the same issue with 2 solutions to this question:

http://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter

* Checking for '_d.pyd' in imp.get_suffixes() => specific to Windows
* sys.executable.endswith("_d.exe") => again, specific to Windows :-(

That's part of my rationale in my first message, we need a portable and reliable flag to check if Python was compiled in debug mode.

By the way, the StackOverflow question comes from an user who is probably not writing a test, but an application. It means that the flag is also helpful to final users.
History
Date User Action Args
2015-10-01 22:33:26vstinnersetrecipients: + vstinner, brett.cannon, ezio.melotti, alex, berker.peksag, serhiy.storchaka, matrixise
2015-10-01 22:33:26vstinnersetmessageid: <1443738806.36.0.807225334682.issue25256@psf.upfronthosting.co.za>
2015-10-01 22:33:26vstinnerlinkissue25256 messages
2015-10-01 22:33:26vstinnercreate