-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use struct.calcsize("P") rather than platform.machine()
platform.machine() gives the wrong answer if you're running 32-bit Python on a 64-bit machine. The reason we don't use platform.architecture() here is that it's not reliable on macOS. See https://stackoverflow.com/a/1405971/823869. Similarly, sys.maxsize is not reliable on Windows. See https://stackoverflow.com/questions/1405913/how-do-i-determine-if-my-python-shell-is-executing-in-32bit-or-64bit-mode-on-os/1405971#comment6209952_1405971 and https://stackoverflow.com/a/3411134/823869. Also use CARGO_CFG_TARGET_POINTER_WIDTH rather than inferring the Rust target pointer width from CARGO_CFG_TARGET_ARCH.
- Loading branch information
1 parent
139a1e6
commit f3876a9
Showing
1 changed file
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters