mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-07-29 01:19:45 +03:00
feat:support parse boolean from characters 0 and 1
This commit is contained in:
parent
9f020124f8
commit
5f7cbe86f2
|
@ -97,11 +97,13 @@ typecast_BOOLEAN_cast(const char *s, Py_ssize_t len, PyObject *curs)
|
|||
if (s == NULL) { Py_RETURN_NONE; }
|
||||
|
||||
switch (s[0]) {
|
||||
case '1':
|
||||
case 't':
|
||||
case 'T':
|
||||
res = Py_True;
|
||||
break;
|
||||
|
||||
case '0':
|
||||
case 'f':
|
||||
case 'F':
|
||||
res = Py_False;
|
||||
|
|
Loading…
Reference in New Issue
Block a user