diff options
| author | arcadia-devtools <[email protected]> | 2022-03-18 09:10:23 +0300 |
|---|---|---|
| committer | arcadia-devtools <[email protected]> | 2022-03-18 09:10:23 +0300 |
| commit | fef2b3a8ed5955b63c71e8e541a5acf2e393925a (patch) | |
| tree | e55d2882d5c2c71561a0aa89158ec174d81f92fd /contrib/tools/python3/src/Modules/_sqlite/statement.c | |
| parent | 2acc0fc3cdc40434ea286f2fac62386e3fd9c19d (diff) | |
intermediate changes
ref:102662f6c42fba80d7bfd4a328124cbb4294be48
Diffstat (limited to 'contrib/tools/python3/src/Modules/_sqlite/statement.c')
| -rw-r--r-- | contrib/tools/python3/src/Modules/_sqlite/statement.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/tools/python3/src/Modules/_sqlite/statement.c b/contrib/tools/python3/src/Modules/_sqlite/statement.c index 23c204e7521..0272ce11207 100644 --- a/contrib/tools/python3/src/Modules/_sqlite/statement.c +++ b/contrib/tools/python3/src/Modules/_sqlite/statement.c @@ -152,9 +152,16 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec rc = sqlite3_bind_int64(self->st, pos, value); break; } - case TYPE_FLOAT: - rc = sqlite3_bind_double(self->st, pos, PyFloat_AsDouble(parameter)); + case TYPE_FLOAT: { + double value = PyFloat_AsDouble(parameter); + if (value == -1 && PyErr_Occurred()) { + rc = -1; + } + else { + rc = sqlite3_bind_double(self->st, pos, value); + } break; + } case TYPE_UNICODE: string = PyUnicode_AsUTF8AndSize(parameter, &buflen); if (string == NULL) |
