Skip to content

Commit 319d60d

Browse files
committed
Third attempt at fixing warning in _json.c
1 parent 5b3c9f8 commit 319d60d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Modules/_json.c

Lines changed: 3 additions & 5 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-
char strict;
21+
signed char strict;
2222
PyObject *object_hook;
2323
PyObject *object_pairs_hook;
2424
PyObject *parse_float;
@@ -1189,7 +1189,6 @@ scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
11891189
PyScannerObject *s;
11901190
PyObject *ctx;
11911191
PyObject *strict;
1192-
int strict_temp;
11931192
static char *kwlist[] = {"context", NULL};
11941193

11951194
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx))
@@ -1208,10 +1207,9 @@ scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
12081207
strict = PyObject_GetAttrString(ctx, "strict");
12091208
if (strict == NULL)
12101209
goto bail;
1211-
strict_temp = PyObject_IsTrue(strict);
1212-
s->strict = (char)strict_temp;
1210+
s->strict = PyObject_IsTrue(strict);
12131211
Py_DECREF(strict);
1214-
if (strict_temp < 0)
1212+
if (s->strict < 0)
12151213
goto bail;
12161214
s->object_hook = PyObject_GetAttrString(ctx, "object_hook");
12171215
if (s->object_hook == NULL)

0 commit comments

Comments
 (0)