mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-29 09:29:46 +03:00
Don't re-initialize psycoEncodings if already initialized
This commit is contained in:
parent
1ac4e7479b
commit
b7a47f5ede
|
@ -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