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 <>
>> 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:

* 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.
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: <>
2015-10-01 22:33:26vstinnerlinkissue25256 messages
2015-10-01 22:33:26vstinnercreate