Only set error string when dict lookup found no matching key (was setting
it for all failures, potentially masking other exceptions).
This commit is contained in:
parent
b497c106d5
commit
dbce2618b1
|
@ -127,9 +127,12 @@ get_dialect_from_registry(PyObject * name_obj)
|
|||
PyObject *dialect_obj;
|
||||
|
||||
dialect_obj = PyDict_GetItem(dialects, name_obj);
|
||||
if (dialect_obj == NULL)
|
||||
return PyErr_Format(error_obj, "unknown dialect");
|
||||
Py_INCREF(dialect_obj);
|
||||
if (dialect_obj == NULL) {
|
||||
if (!PyErr_Occurred())
|
||||
PyErr_Format(error_obj, "unknown dialect");
|
||||
}
|
||||
else
|
||||
Py_INCREF(dialect_obj);
|
||||
return dialect_obj;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue