diff options
author | Petri Lehtinen <petri@digip.org> | 2012-02-09 19:09:03 (GMT) |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2012-02-09 19:09:03 (GMT) |
commit | bc35bebb458c6d3ad74adaf0d75f5156ab89fec9 (patch) | |
tree | 727e472a4ba702f48fb42d4b7246edc529d1aa67 /Modules/_sqlite/module.c | |
parent | f0f9679d5ce6b65f4b41f1c42b24c6ab43923a41 (diff) | |
download | cpython-bc35bebb458c6d3ad74adaf0d75f5156ab89fec9.zip cpython-bc35bebb458c6d3ad74adaf0d75f5156ab89fec9.tar.gz cpython-bc35bebb458c6d3ad74adaf0d75f5156ab89fec9.tar.bz2 |
Undocument and clean up sqlite3.OptimizedUnicode
Closes #13921.
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++) { |