diff options
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r-- | Modules/_sqlite/module.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 406d787..bea6d6a 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -37,7 +37,7 @@ PyObject* pysqlite_Error, *pysqlite_Warning, *pysqlite_InterfaceError, *pysqlite_DatabaseError, *pysqlite_InternalError, *pysqlite_OperationalError, *pysqlite_ProgrammingError, - *pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError, *pysqlite_OptimizedUnicode; + *pysqlite_IntegrityError, *pysqlite_DataError, *pysqlite_NotSupportedError; PyObject* converters; int _enable_callback_tracebacks; @@ -407,13 +407,13 @@ PyMODINIT_FUNC PyInit__sqlite3(void) } PyDict_SetItemString(dict, "NotSupportedError", pysqlite_NotSupportedError); - /* We just need "something" unique for pysqlite_OptimizedUnicode. It does not really - * need to be a string subclass. Just anything that can act as a special - * marker for us. So I pulled PyCell_Type out of my magic hat. - */ - Py_INCREF((PyObject*)&PyCell_Type); - pysqlite_OptimizedUnicode = (PyObject*)&PyCell_Type; - PyDict_SetItemString(dict, "OptimizedUnicode", pysqlite_OptimizedUnicode); + /* In Python 2.x, setting Connection.text_factory to + OptimizedUnicode caused Unicode objects to be returned for + non-ASCII data and bytestrings to be returned for ASCII data. + Now OptimizedUnicode is an alias for str, so it has no + effect. */ + Py_INCREF((PyObject*)&PyUnicode_Type); + PyDict_SetItemString(dict, "OptimizedUnicode", (PyObject*)&PyUnicode_Type); /* Set integer constants */ for (i = 0; _int_constants[i].constant_name != 0; i++) { |