Skip to content

Commit 4e05b9b

Browse files
committed
Fix embarassing off-by-one error in error report
1 parent 4b9c943 commit 4e05b9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Python/modsupport.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -735,15 +735,15 @@ int PyABIInfo_Check(PyABIInfo *info, const char *module_name)
735735
return _abiinfo_raise(
736736
module_name,
737737
"incompatible future stable ABI version (%d.%d)",
738-
((info->abi_version) >> 24) % 0xff,
739-
((info->abi_version) >> 16) % 0xff);
738+
((info->abi_version) >> 24) & 0xff,
739+
((info->abi_version) >> 16) & 0xff);
740740
}
741741
if (info->abi_version < Py_PACK_VERSION(3, 2)) {
742742
return _abiinfo_raise(
743743
module_name,
744744
"invalid stable ABI version (%d.%d)",
745-
((info->abi_version) >> 24) % 0xff,
746-
((info->abi_version) >> 16) % 0xff);
745+
((info->abi_version) >> 24) & 0xff,
746+
((info->abi_version) >> 16) & 0xff);
747747
}
748748
}
749749
if (info->flags & PyABIInfo_INTERNAL) {
@@ -758,8 +758,8 @@ int PyABIInfo_Check(PyABIInfo *info, const char *module_name)
758758
return _abiinfo_raise(
759759
module_name,
760760
"incompatible ABI version (%d.%d)",
761-
((info->abi_version) >> 24) % 0xff,
762-
((info->abi_version) >> 16) % 0xff);
761+
((info->abi_version) >> 24) & 0xff,
762+
((info->abi_version) >> 16) & 0xff);
763763
}
764764
}
765765
}

0 commit comments

Comments
 (0)