summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2016-10-02 00:33:39 -0500
committerZachary Ware <zachary.ware@gmail.com>2016-10-02 00:33:39 -0500
commit854adb1e0175dc915f5b611a2c780df6213d7c4b (patch)
tree8cf57ec3b8532c27018fbf9628862536304e388d
parent14b4b41cdc5c44ede1496ae6d5f76373fe67e8ef (diff)
downloadcpython-git-854adb1e0175dc915f5b611a2c780df6213d7c4b.tar.gz
Issue #21124: Fix building _struct on Cygwin.
Patch by Masayuki Yamamoto.
-rw-r--r--Misc/NEWS4
-rw-r--r--Modules/_struct.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 96a5c907fa..b7fc2ae0c4 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -175,6 +175,10 @@ Windows
Build
-----
+- Issue #21124: Fix building the _struct module on Cygwin by passing ``NULL``
+ instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT. Patch by Masayuki
+ Yamamoto.
+
- Issue #13756: Fix building extensions modules on Cygwin. Patch by Roumen
Petrov, based on original patch by Jason Tishler.
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 796d1682f0..9d48691c8a 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1650,7 +1650,7 @@ unpackiter_iternext(unpackiterobject *self)
}
static PyTypeObject unpackiter_type = {
- PyVarObject_HEAD_INIT(&PyType_Type, 0)
+ PyVarObject_HEAD_INIT(NULL, 0)
"unpack_iterator", /* tp_name */
sizeof(unpackiterobject), /* tp_basicsize */
0, /* tp_itemsize */