Skip to content

Commit

Permalink
Fix #172: Compute ABI correctly for Python < 3.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsajip committed Jul 9, 2022
1 parent 9b535c3 commit 1196d31
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ Released: Not yet.

- Fixed #169: Removed usage of deprecated imp module in favour of importlib.

- Fixed #172: Compute ABI correctly for Python < 3.8.

In addition to the above, setup.py was replaced by setup.cfg and pyproject.toml.

0.3.4
Expand Down
16 changes: 12 additions & 4 deletions distlib/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ def _derive_abi():
parts = ['cp', VER_SUFFIX]
if sysconfig.get_config_var('Py_DEBUG'):
parts.append('d')
if sysconfig.get_config_var('WITH_PYMALLOC'):
parts.append('m')
if sysconfig.get_config_var('Py_UNICODE_SIZE') == 4:
parts.append('u')
if IMP_PREFIX == 'cp':
vi = sys.version_info[:2]
if vi < (3, 8):
wpm = sysconfig.get_config_var('WITH_PYMALLOC')
if wpm is None:
wpm = True
if wpm:
parts.append('m')
if vi < (3, 3):
us = sysconfig.get_config_var('Py_UNICODE_SIZE')
if us == 4 or (us is None and sys.maxunicode == 0x10FFFF):
parts.append('u')
return ''.join(parts)
ABI = _derive_abi()
del _derive_abi
Expand Down

0 comments on commit 1196d31

Please sign in to comment.