Skip to content

Commit e34b80b

Browse files
Simplify calculation of version hex
Co-authored-by: Conor MacBride <[email protected]>
1 parent cdfeeac commit e34b80b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

extension_helpers/_setup_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def _abi_to_version_info(abi):
4242
return int(match[1]), int(match[2])
4343

4444

45-
def _version_info_to_version_hex(major=0, minor=0, micro=0,
46-
releaselevel=0, serial=0):
47-
return f'0x{major:0>2}{minor:0>2}{micro:0>2}{releaselevel:0>2}{serial:0>2}'
45+
def _version_info_to_version_hex(major=0, minor=0):
46+
"""Returns a PY_VERSION_HEX for {major}.{minor).0"""
47+
return f'0x{major:02x}{minor:02x}0000'
4848

4949

5050
def get_extensions(srcdir='.'):

0 commit comments

Comments
 (0)