]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 31 Mar 2020 12:26:05 +0000 (05:26 -0700)
committerGitHub <noreply@github.com>
Tue, 31 Mar 2020 12:26:05 +0000 (05:26 -0700)
(cherry picked from commit 472fc843ca816d65c12f9508ac762ca492165c45)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
Modules/_struct.c

index 9281c6803f3a68da66b8b4d7a0160238b1cc0b09..1c917b7513f46724b523a3ddc47e99f0f0c8a89b 100644 (file)
@@ -2365,6 +2365,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;