]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
authorStefan Krah <skrah@bytereef.org>
Tue, 24 Mar 2020 13:01:13 +0000 (14:01 +0100)
committerGitHub <noreply@github.com>
Tue, 24 Mar 2020 13:01:13 +0000 (06:01 -0700)
Modules/_struct.c

index b4b52a754fcc7af0217c46d14b1a013b0fd3e25c..242ca9c10df2de221dda0c96e8fff94e4f162ccc 100644 (file)
@@ -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;