-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
gh-127405: Add ABIFLAGS to sysconfig.get_config_vars() on Windows
#131799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
31b7eab
dc45897
9a4586a
76c85bb
b98419b
4729f76
04cbb1c
a6045ea
584e0b0
93257be
30c7b56
97942b2
917874c
f49067e
8fa952b
08d92db
b667dd9
30cf6c7
5df9540
018aae3
4f22ff3
f918241
a4646c5
7b21d7d
1ee8230
084deac
af50632
b397f40
1a82cd1
7990798
0744690
518137b
486e2a8
3bccf1d
780f340
98c26f9
e236bc7
0d8bcdd
278556c
5689c1f
299cec6
21d2e73
d265a59
f3b8570
fe4ea95
da2b4ce
64f0961
8b16454
1c807f0
fbb86f5
b702ff9
932386c
23b6e6c
75b6c51
3c91201
d55b3e6
a084070
d2255e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Py_DEBUG over _DEBUG
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,14 +65,7 @@ _sysconfig_config_vars_impl(PyObject *module) | |
| "t" | ||
| # endif | ||
| # ifdef Py_DEBUG | ||
| # ifndef _DEBUG | ||
| # error "_DEBUG not defined while Py_DEBUG is defined on Windows" | ||
| # endif | ||
| "d" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think making this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Can't we use something like this? def add_underscore_d(x):
if os.name == 'nt':
return x.replace('d', '_d')
return x
executable = f'python{version}{add_underscore_d(ABIFLAGS)}.exe'Explicit is better than implicit.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It isn't "we" - it's "every single user ever for the rest of time". Our job as core maintainers is to do more work and make less obvious decisions so that every single user doesn't have to. Don't bother quoting the zen at me either. "Special cases aren't special enough" applies just as well here, as does "one obvious way" (which is to use If you want to run with the "explicit > implicit" argument, here's a more explicit version: Inserting an underscore is neither explicit, nor obvious, and is definitely a special case that isn't special enough to not just use a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the underscore prefix in the Python code so that developers can introspect the source more easily.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A constraint of the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Users can't split up the value anyway, that's not what it's for. You can parse it specifically, which basically amounts to an
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't understand why this definition needs to be in the native module, instead of generating it in the Python code.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally, as you say, all these variables should be defined in On Windows, we don't parse If not set in So basically, tier 2 is closer to ideal than tier 3 would be, and importantly it makes it clearer that this is exposing an internally defined value, rather than trying to adhere to some kind of definition of what Footnotes
|
||
| # else | ||
| # ifdef _DEBUG | ||
| # error "_DEBUG defined while Py_DEBUG is not defined on Windows" | ||
| # endif | ||
| # endif | ||
| "") | ||
| < 0) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.