8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e6c1c4 commit 30655faCopy full SHA for 30655fa
Modules/_csv.c
@@ -160,15 +160,9 @@ static PyObject *
160
get_dialect_from_registry(PyObject *name_obj, _csvstate *module_state)
161
{
162
PyObject *dialect_obj;
163
-
164
- dialect_obj = PyDict_GetItemWithError(module_state->dialects, name_obj);
165
- if (dialect_obj == NULL) {
166
- if (!PyErr_Occurred())
167
- PyErr_Format(module_state->error_obj, "unknown dialect");
+ if (PyDict_GetItemRef(module_state->dialects, name_obj, &dialect_obj) == 0) {
+ PyErr_SetString(module_state->error_obj, "unknown dialect");
168
}
169
- else
170
- Py_INCREF(dialect_obj);
171
172
return dialect_obj;
173
174
0 commit comments