Don't re-initialize psycoEncodings if already initialized

This commit is contained in:
Sandro Mani 2021-05-03 23:30:13 +02:00 committed by Daniele Varrazzo
parent 22575528be
commit f59d626fe3

View File

@ -608,6 +608,10 @@ encodings_init(PyObject *module)
int rv = -1;
Dprintf("psycopgmodule: initializing encodings table");
if (psycoEncodings) {
Dprintf("encodings_init(): already called");
return 0;
}
if (!(psycoEncodings = PyDict_New())) { goto exit; }
Py_INCREF(psycoEncodings);