From: Georg Brandl <georg@python.org>
Date: Mon, 14 Oct 2013 04:46:12 +0000 (+0200)
Subject: Re #18521: fix not-quite-C syntax that works only because the PyXXX_Check are macros... 
X-Git-Tag: v3.4.0a4~110
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=782952b8fe7fd8b22987e71fd5e21526559540ff;p=python

Re #18521: fix not-quite-C syntax that works only because the PyXXX_Check are macros defined with () around them.
---

diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index a93290e39c..7452202354 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -4202,7 +4202,7 @@ Array_subscript(PyObject *_self, PyObject *item)
             i += self->b_length;
         return Array_item(_self, i);
     }
-    else if PySlice_Check(item) {
+    else if (PySlice_Check(item)) {
         StgDictObject *stgdict, *itemdict;
         PyObject *proto;
         PyObject *np;
diff --git a/Modules/_testbuffer.c b/Modules/_testbuffer.c
index a4e1643a0d..0c6ef16f17 100644
--- a/Modules/_testbuffer.c
+++ b/Modules/_testbuffer.c
@@ -1815,7 +1815,7 @@ ndarray_subscript(NDArrayObject *self, PyObject *key)
         if (init_slice(base, key, 0) < 0)
             goto err_occurred;
     }
-    else if PyTuple_Check(key) {
+    else if (PyTuple_Check(key)) {
         /* multi-dimensional slice */
         PyObject *tuple = key;
         Py_ssize_t i, n;