mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 04:13:43 +03:00
Don't re-initialize psycoEncodings if already initialized
This commit is contained in:
parent
22575528be
commit
f59d626fe3
|
@ -608,6 +608,10 @@ encodings_init(PyObject *module)
|
||||||
int rv = -1;
|
int rv = -1;
|
||||||
|
|
||||||
Dprintf("psycopgmodule: initializing encodings table");
|
Dprintf("psycopgmodule: initializing encodings table");
|
||||||
|
if (psycoEncodings) {
|
||||||
|
Dprintf("encodings_init(): already called");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(psycoEncodings = PyDict_New())) { goto exit; }
|
if (!(psycoEncodings = PyDict_New())) { goto exit; }
|
||||||
Py_INCREF(psycoEncodings);
|
Py_INCREF(psycoEncodings);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user