Simplify get_flag() conditionals in get_abi_tag() [pep425tags]#6889
Conversation
| sys.version_info < (3, 8))) \ | ||
| and sys.version_info < (3, 8): | ||
| if sys.version_info < (3, 8) and get_flag( | ||
| 'WITH_PYMALLOC', lambda: impl == 'cp', warn=(impl == 'cp')): |
There was a problem hiding this comment.
I would do is_cpython = impl == 'cp' above and use it everywhere.
There was a problem hiding this comment.
I was planning on doing exactly this. :)
| @@ -115,18 +115,12 @@ def get_abi_tag(): | |||
| lambda: hasattr(sys, 'gettotalrefcount'), | |||
| warn=(impl == 'cp')): | |||
There was a problem hiding this comment.
I wonder why we only warn for CPython, are these totally sure things on PyPy?
There was a problem hiding this comment.
For comparison, you may want to look at the newer packaging.tags to see if behavior like this got preserved.
There was a problem hiding this comment.
The warning is if they’re missing, so I’m guessing it’s because they aren’t known to be required on other implementations (so the warnings would risk being spurious).
There was a problem hiding this comment.
In packaging.tags the behavior did not get preserved, which may be a bug on Windows (filed at pypa/packaging#181).
That seems reasonable.
|
Thanks! |
…itionals Simplify get_flag() conditionals in get_abi_tag() [pep425tags]
This simplifies a couple conditionals in
pep425tags.py'sget_abi_tag()function, as mentioned in this comment to PR #6874.