summaryrefslogtreecommitdiff
path: root/Modules/_sqlite/module.c
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2017-02-04 09:34:48 +0300
committerBerker Peksag <berker.peksag@gmail.com>2017-02-04 09:34:48 +0300
commit3821030b7ba4a7ff5d34c33deff4f6886130a951 (patch)
tree21dbd98647a8fa6937cc0de0a8d76947f7593ad6 /Modules/_sqlite/module.c
parentacbb71ea58f932980f795e7582309fc2b33490eb (diff)
parent678487eb345f9f9dea3d3818ecad7d39145bdc65 (diff)
downloadcpython-3821030b7ba4a7ff5d34c33deff4f6886130a951.tar.gz
Issue #29198: Merge from 3.5
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r--Modules/_sqlite/module.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c
index 7a7e86040a..cc45331ab5 100644
--- a/Modules/_sqlite/module.c
+++ b/Modules/_sqlite/module.c
@@ -139,8 +139,7 @@ static PyObject* module_enable_shared_cache(PyObject* self, PyObject* args, PyOb
PyErr_SetString(pysqlite_OperationalError, "Changing the shared_cache flag failed");
return NULL;
} else {
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
}
@@ -172,8 +171,7 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
if (rc == -1)
return NULL;
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(module_register_adapter_doc,
@@ -194,7 +192,7 @@ static PyObject* module_register_converter(PyObject* self, PyObject* args)
}
/* convert the name to upper case */
- name = _PyObject_CallMethodId(orig_name, &PyId_upper, "");
+ name = _PyObject_CallMethodId(orig_name, &PyId_upper, NULL);
if (!name) {
goto error;
}
@@ -221,8 +219,7 @@ static PyObject* enable_callback_tracebacks(PyObject* self, PyObject* args)
return NULL;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
PyDoc_STRVAR(enable_callback_tracebacks_doc,
@@ -261,13 +258,13 @@ static PyMethodDef module_methods[] = {
};
struct _IntConstantPair {
- char* constant_name;
+ const char *constant_name;
int constant_value;
};
typedef struct _IntConstantPair IntConstantPair;
-static IntConstantPair _int_constants[] = {
+static const IntConstantPair _int_constants[] = {
{"PARSE_DECLTYPES", PARSE_DECLTYPES},
{"PARSE_COLNAMES", PARSE_COLNAMES},