Skip to content

Commit 5b3c9f8

Browse files
committed
Second attempt at fixing the warning
1 parent d9ede9c commit 5b3c9f8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Modules/_json.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static PyTypeObject PyEncoderType;
1818

1919
typedef struct _PyScannerObject {
2020
PyObject_HEAD
21-
int strict;
21+
char strict;
2222
PyObject *object_hook;
2323
PyObject *object_pairs_hook;
2424
PyObject *parse_float;
@@ -1189,6 +1189,7 @@ scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
11891189
PyScannerObject *s;
11901190
PyObject *ctx;
11911191
PyObject *strict;
1192+
int strict_temp;
11921193
static char *kwlist[] = {"context", NULL};
11931194

11941195
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx))
@@ -1207,9 +1208,10 @@ scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
12071208
strict = PyObject_GetAttrString(ctx, "strict");
12081209
if (strict == NULL)
12091210
goto bail;
1210-
s->strict = PyObject_IsTrue(strict);
1211+
strict_temp = PyObject_IsTrue(strict);
1212+
s->strict = (char)strict_temp;
12111213
Py_DECREF(strict);
1212-
if (s->strict < 0)
1214+
if (strict_temp < 0)
12131215
goto bail;
12141216
s->object_hook = PyObject_GetAttrString(ctx, "object_hook");
12151217
if (s->object_hook == NULL)

0 commit comments

Comments
 (0)