mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-29 20:23:45 +03:00
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
without holding the GIL.
This commit is contained in:
parent
14135c1d7e
commit
e55e2683cf
|
@ -1,3 +1,8 @@
|
|||
2008-03-07 James Henstridge <james@jamesh.id.au>
|
||||
|
||||
* psycopg/pqpath.c (_pq_fetch_tuples): Don't call Python APIs
|
||||
without holding the GIL.
|
||||
|
||||
2008-02-27 James Henstridge <james@jamesh.id.au>
|
||||
|
||||
* NEWS: add some draft NEWS items for a 2.0.7 release.
|
||||
|
|
|
@ -688,12 +688,13 @@ _pq_fetch_tuples(cursorObject *curs)
|
|||
int fsize = PQfsize(curs->pgres, i);
|
||||
int fmod = PQfmod(curs->pgres, i);
|
||||
|
||||
PyObject *dtitem = PyTuple_New(7);
|
||||
PyObject *type = PyInt_FromLong(ftype);
|
||||
PyObject *dtitem;
|
||||
PyObject *type;
|
||||
PyObject *cast = NULL;
|
||||
|
||||
Py_BLOCK_THREADS;
|
||||
|
||||
dtitem = PyTuple_New(7);
|
||||
PyTuple_SET_ITEM(curs->description, i, dtitem);
|
||||
|
||||
/* fill the right cast function by accessing three different dictionaries:
|
||||
|
@ -702,6 +703,7 @@ _pq_fetch_tuples(cursorObject *curs)
|
|||
- the global dictionary (at module level)
|
||||
if we get no defined cast use the default one */
|
||||
|
||||
type = PyInt_FromLong(ftype);
|
||||
Dprintf("_pq_fetch_tuples: looking for cast %d:", ftype);
|
||||
if (curs->string_types != NULL && curs->string_types != Py_None) {
|
||||
cast = PyDict_GetItem(curs->string_types, type);
|
||||
|
|
Loading…
Reference in New Issue
Block a user