summaryrefslogtreecommitdiff
path: root/Modules/_json.c
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-02-01 22:38:12 +0300
committerBerker Peksag <berker.peksag@gmail.com>2017-02-01 22:38:12 +0300
commitb64c0079822007c7846e7d3eb6e6f6b5d82d3a03 (patch)
tree61860585c5d1c1e62275cdc449be5d7494c143b8 /Modules/_json.c
parenta706118dafc16edfed490c53db02c08aefe7b097 (diff)
parent0e4701169a3e3a022f03997399d04d28ca90c620 (diff)
downloadcpython-b64c0079822007c7846e7d3eb6e6f6b5d82d3a03.tar.gz
Issue #29407: Merge from 3.6
Diffstat (limited to 'Modules/_json.c')
-rw-r--r--Modules/_json.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index faa213491b..f4000f83a5 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -335,7 +335,7 @@ raise_errmsg(const char *msg, PyObject *s, Py_ssize_t end)
if (JSONDecodeError == NULL)
return;
}
- exc = PyObject_CallFunction(JSONDecodeError, "(zOn)", msg, s, end);
+ exc = PyObject_CallFunction(JSONDecodeError, "zOn", msg, s, end);
if (exc) {
PyErr_SetObject(JSONDecodeError, exc);
Py_DECREF(exc);
@@ -1108,17 +1108,15 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
case 'n':
/* null */
if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'u' && PyUnicode_READ(kind, str, idx + 2) == 'l' && PyUnicode_READ(kind, str, idx + 3) == 'l') {
- Py_INCREF(Py_None);
*next_idx_ptr = idx + 4;
- return Py_None;
+ Py_RETURN_NONE;
}
break;
case 't':
/* true */
if ((idx + 3 < length) && PyUnicode_READ(kind, str, idx + 1) == 'r' && PyUnicode_READ(kind, str, idx + 2) == 'u' && PyUnicode_READ(kind, str, idx + 3) == 'e') {
- Py_INCREF(Py_True);
*next_idx_ptr = idx + 4;
- return Py_True;
+ Py_RETURN_TRUE;
}
break;
case 'f':
@@ -1127,9 +1125,8 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
PyUnicode_READ(kind, str, idx + 2) == 'l' &&
PyUnicode_READ(kind, str, idx + 3) == 's' &&
PyUnicode_READ(kind, str, idx + 4) == 'e') {
- Py_INCREF(Py_False);
*next_idx_ptr = idx + 5;
- return Py_False;
+ Py_RETURN_FALSE;
}
break;
case 'N':
@@ -1609,7 +1606,7 @@ encoder_listencode_dict(PyEncoderObject *s, _PyAccu *acc,
if (open_dict == NULL || close_dict == NULL || empty_dict == NULL)
return -1;
}
- if (PyDict_Size(dct) == 0) /* Fast path */
+ if (PyDict_GET_SIZE(dct) == 0) /* Fast path */
return _PyAccu_Accumulate(acc, empty_dict);
if (s->markers != Py_None) {