Mercurial > cpython-lru_cache-weakref
comparison Modules/_sqlite/module.c @ 47294:4fe192d48960 legacy-trunk
Renamed PyString to PyBytes
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Mon, 26 May 2008 12:51:38 +0000 |
| parents | b7ee9074ca0e |
| children | 52294af4b663 |
comparison
equal
deleted
inserted
replaced
| 47292:abafccfe7501 | 47294:4fe192d48960 |
|---|---|
| 135 } | 135 } |
| 136 | 136 |
| 137 /* a basic type is adapted; there's a performance optimization if that's not the case | 137 /* a basic type is adapted; there's a performance optimization if that's not the case |
| 138 * (99 % of all usages) */ | 138 * (99 % of all usages) */ |
| 139 if (type == &PyInt_Type || type == &PyLong_Type || type == &PyFloat_Type | 139 if (type == &PyInt_Type || type == &PyLong_Type || type == &PyFloat_Type |
| 140 || type == &PyString_Type || type == &PyUnicode_Type || type == &PyBuffer_Type) { | 140 || type == &PyBytes_Type || type == &PyUnicode_Type || type == &PyBuffer_Type) { |
| 141 pysqlite_BaseTypeAdapted = 1; | 141 pysqlite_BaseTypeAdapted = 1; |
| 142 } | 142 } |
| 143 | 143 |
| 144 microprotocols_add(type, (PyObject*)&pysqlite_PrepareProtocolType, caster); | 144 microprotocols_add(type, (PyObject*)&pysqlite_PrepareProtocolType, caster); |
| 145 | 145 |
| 365 } | 365 } |
| 366 PyDict_SetItemString(dict, _int_constants[i].constant_name, tmp_obj); | 366 PyDict_SetItemString(dict, _int_constants[i].constant_name, tmp_obj); |
| 367 Py_DECREF(tmp_obj); | 367 Py_DECREF(tmp_obj); |
| 368 } | 368 } |
| 369 | 369 |
| 370 if (!(tmp_obj = PyString_FromString(PYSQLITE_VERSION))) { | 370 if (!(tmp_obj = PyBytes_FromString(PYSQLITE_VERSION))) { |
| 371 goto error; | 371 goto error; |
| 372 } | 372 } |
| 373 PyDict_SetItemString(dict, "version", tmp_obj); | 373 PyDict_SetItemString(dict, "version", tmp_obj); |
| 374 Py_DECREF(tmp_obj); | 374 Py_DECREF(tmp_obj); |
| 375 | 375 |
| 376 if (!(tmp_obj = PyString_FromString(sqlite3_libversion()))) { | 376 if (!(tmp_obj = PyBytes_FromString(sqlite3_libversion()))) { |
| 377 goto error; | 377 goto error; |
| 378 } | 378 } |
| 379 PyDict_SetItemString(dict, "sqlite_version", tmp_obj); | 379 PyDict_SetItemString(dict, "sqlite_version", tmp_obj); |
| 380 Py_DECREF(tmp_obj); | 380 Py_DECREF(tmp_obj); |
| 381 | 381 |
