#ifdef _CTYPES_DEBUG_KEEP
#define _RET(x) Py_INCREF(x); return x
#else
-#define _RET(X) Py_INCREF(Py_None); return Py_None
+#define _RET(X) Py_RETURN_NONE
#endif
/*****************************************************************
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':
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':
Py_LOCAL_INLINE(PyObject *)
SubString_new_object(SubString *str)
{
- if (str->str == NULL) {
- Py_INCREF(Py_None);
- return Py_None;
- }
+ if (str->str == NULL)
+ Py_RETURN_NONE;
return PyUnicode_Substring(str->str, str->start, str->end);
}