summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2020-03-24 14:01:13 +0100
committerGitHub <noreply@github.com>2020-03-24 06:01:13 -0700
commit472fc843ca816d65c12f9508ac762ca492165c45 (patch)
treedb46841bdc9f8d0f5b78d89b64de9eaacd7d8b51
parent6000087fe979705dc588a46a35da884cc0198c67 (diff)
downloadcpython-git-472fc843ca816d65c12f9508ac762ca492165c45.tar.gz
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
-rw-r--r--Modules/_struct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index b4b52a754f..242ca9c10d 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -2407,6 +2407,9 @@ PyInit__struct(void)
"unknown" float format */
if (ptr->format == 'd' || ptr->format == 'f')
break;
+ /* Skip _Bool, semantics are different for standard size */
+ if (ptr->format == '?')
+ break;
ptr->pack = native->pack;
ptr->unpack = native->unpack;
break;