[Python-checkins] bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)

Stefan Krah webhook-mailer at python.org
Tue Mar 24 09:01:23 EDT 2020


https://github.com/python/cpython/commit/472fc843ca816d65c12f9508ac762ca492165c45
commit: 472fc843ca816d65c12f9508ac762ca492165c45
branch: master
author: Stefan Krah <skrah at bytereef.org>
committer: GitHub <noreply at github.com>
date: 2020-03-24T06:01:13-07:00
summary:

bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)

files:
M Modules/_struct.c

diff --git a/Modules/_struct.c b/Modules/_struct.c
index b4b52a754fcc7..242ca9c10df2d 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;



More information about the Python-checkins mailing list