Skip to content

Commit 173d474

Browse files
author
anthony.baxter
committed
upgrade to final version of pysqlite 2.2.0
git-svn-id: http://svn.python.org/projects/python/trunk@43668 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 4a3a84b commit 173d474

File tree

11 files changed

+30
-38
lines changed

11 files changed

+30
-38
lines changed

Modules/_sqlite/cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static PyMethodDef cache_methods[] = {
262262
PyTypeObject NodeType = {
263263
PyObject_HEAD_INIT(NULL)
264264
0, /* ob_size */
265-
"pysqlite2.dbapi2.Node", /* tp_name */
265+
MODULE_NAME "Node", /* tp_name */
266266
sizeof(Node), /* tp_basicsize */
267267
0, /* tp_itemsize */
268268
(destructor)node_dealloc, /* tp_dealloc */
@@ -305,7 +305,7 @@ PyTypeObject NodeType = {
305305
PyTypeObject CacheType = {
306306
PyObject_HEAD_INIT(NULL)
307307
0, /* ob_size */
308-
"pysqlite2.dbapi2.Cache", /* tp_name */
308+
MODULE_NAME ".Cache", /* tp_name */
309309
sizeof(Cache), /* tp_basicsize */
310310
0, /* tp_itemsize */
311311
(destructor)cache_dealloc, /* tp_dealloc */

Modules/_sqlite/connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ static struct PyMemberDef connection_members[] =
10291029
PyTypeObject ConnectionType = {
10301030
PyObject_HEAD_INIT(NULL)
10311031
0, /* ob_size */
1032-
"pysqlite2.dbapi2.Connection", /* tp_name */
1032+
MODULE_NAME ".Connection", /* tp_name */
10331033
sizeof(Connection), /* tp_basicsize */
10341034
0, /* tp_itemsize */
10351035
(destructor)connection_dealloc, /* tp_dealloc */

Modules/_sqlite/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ static struct PyMemberDef cursor_members[] =
977977
PyTypeObject CursorType = {
978978
PyObject_HEAD_INIT(NULL)
979979
0, /* ob_size */
980-
"pysqlite2.dbapi2.Cursor", /* tp_name */
980+
MODULE_NAME ".Cursor", /* tp_name */
981981
sizeof(Cursor), /* tp_basicsize */
982982
0, /* tp_itemsize */
983983
(destructor)cursor_dealloc, /* tp_dealloc */

Modules/_sqlite/microprotocols.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,19 @@ int
5555
microprotocols_add(PyTypeObject *type, PyObject *proto, PyObject *cast)
5656
{
5757
PyObject* key;
58+
int rc;
5859

5960
if (proto == NULL) proto = (PyObject*)&SQLitePrepareProtocolType;
6061

61-
/*
62-
Dprintf("microprotocols_add: cast %p for (%s, ?)",
63-
cast, type->tp_name);
64-
*/
65-
66-
6762
key = Py_BuildValue("(OO)", (PyObject*)type, proto);
6863
if (!key) {
6964
return -1;
7065
}
7166

72-
if (PyDict_SetItem(psyco_adapters, key, cast) != 0) {
73-
Py_DECREF(key);
74-
return -1;
75-
}
76-
67+
rc = PyDict_SetItem(psyco_adapters, key, cast);
7768
Py_DECREF(key);
7869

79-
return 0;
70+
return rc;
8071
}
8172

8273
/* microprotocols_adapt - adapt an object to the built-in protocol */

Modules/_sqlite/module.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -214,56 +214,56 @@ PyMODINIT_FUNC init_sqlite3(void)
214214

215215
/*** Create DB-API Exception hierarchy */
216216

217-
if (!(Error = PyErr_NewException("sqlite3.Error", PyExc_StandardError, NULL))) {
217+
if (!(Error = PyErr_NewException(MODULE_NAME ".Error", PyExc_StandardError, NULL))) {
218218
goto error;
219219
}
220220
PyDict_SetItemString(dict, "Error", Error);
221221

222-
if (!(Warning = PyErr_NewException("sqlite3.Warning", PyExc_StandardError, NULL))) {
222+
if (!(Warning = PyErr_NewException(MODULE_NAME ".Warning", PyExc_StandardError, NULL))) {
223223
goto error;
224224
}
225225
PyDict_SetItemString(dict, "Warning", Warning);
226226

227227
/* Error subclasses */
228228

229-
if (!(InterfaceError = PyErr_NewException("sqlite3.InterfaceError", Error, NULL))) {
229+
if (!(InterfaceError = PyErr_NewException(MODULE_NAME ".InterfaceError", Error, NULL))) {
230230
goto error;
231231
}
232232
PyDict_SetItemString(dict, "InterfaceError", InterfaceError);
233233

234-
if (!(DatabaseError = PyErr_NewException("sqlite3.DatabaseError", Error, NULL))) {
234+
if (!(DatabaseError = PyErr_NewException(MODULE_NAME ".DatabaseError", Error, NULL))) {
235235
goto error;
236236
}
237237
PyDict_SetItemString(dict, "DatabaseError", DatabaseError);
238238

239239
/* DatabaseError subclasses */
240240

241-
if (!(InternalError = PyErr_NewException("sqlite3.InternalError", DatabaseError, NULL))) {
241+
if (!(InternalError = PyErr_NewException(MODULE_NAME ".InternalError", DatabaseError, NULL))) {
242242
goto error;
243243
}
244244
PyDict_SetItemString(dict, "InternalError", InternalError);
245245

246-
if (!(OperationalError = PyErr_NewException("sqlite3.OperationalError", DatabaseError, NULL))) {
246+
if (!(OperationalError = PyErr_NewException(MODULE_NAME ".OperationalError", DatabaseError, NULL))) {
247247
goto error;
248248
}
249249
PyDict_SetItemString(dict, "OperationalError", OperationalError);
250250

251-
if (!(ProgrammingError = PyErr_NewException("sqlite3.ProgrammingError", DatabaseError, NULL))) {
251+
if (!(ProgrammingError = PyErr_NewException(MODULE_NAME ".ProgrammingError", DatabaseError, NULL))) {
252252
goto error;
253253
}
254254
PyDict_SetItemString(dict, "ProgrammingError", ProgrammingError);
255255

256-
if (!(IntegrityError = PyErr_NewException("sqlite3.IntegrityError", DatabaseError,NULL))) {
256+
if (!(IntegrityError = PyErr_NewException(MODULE_NAME ".IntegrityError", DatabaseError,NULL))) {
257257
goto error;
258258
}
259259
PyDict_SetItemString(dict, "IntegrityError", IntegrityError);
260260

261-
if (!(DataError = PyErr_NewException("sqlite3.DataError", DatabaseError, NULL))) {
261+
if (!(DataError = PyErr_NewException(MODULE_NAME ".DataError", DatabaseError, NULL))) {
262262
goto error;
263263
}
264264
PyDict_SetItemString(dict, "DataError", DataError);
265265

266-
if (!(NotSupportedError = PyErr_NewException("sqlite3.NotSupportedError", DatabaseError, NULL))) {
266+
if (!(NotSupportedError = PyErr_NewException(MODULE_NAME ".NotSupportedError", DatabaseError, NULL))) {
267267
goto error;
268268
}
269269
PyDict_SetItemString(dict, "NotSupportedError", NotSupportedError);
@@ -320,6 +320,6 @@ PyMODINIT_FUNC init_sqlite3(void)
320320
error:
321321
if (PyErr_Occurred())
322322
{
323-
PyErr_SetString(PyExc_ImportError, "_sqlite3: init failed");
323+
PyErr_SetString(PyExc_ImportError, MODULE_NAME ": init failed");
324324
}
325325
}

Modules/_sqlite/module.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#define PYSQLITE_MODULE_H
2626
#include "Python.h"
2727

28+
#define PYSQLITE_VERSION "2.2.0"
29+
2830
extern PyObject* Error;
2931
extern PyObject* Warning;
3032
extern PyObject* InterfaceError;

Modules/_sqlite/prepare_protocol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void prepare_protocol_dealloc(SQLitePrepareProtocol* self)
3636
PyTypeObject SQLitePrepareProtocolType= {
3737
PyObject_HEAD_INIT(NULL)
3838
0, /* ob_size */
39-
"pysqlite2.dbapi2.PrepareProtocol", /* tp_name */
39+
MODULE_NAME ".PrepareProtocol", /* tp_name */
4040
sizeof(SQLitePrepareProtocol), /* tp_basicsize */
4141
0, /* tp_itemsize */
4242
(destructor)prepare_protocol_dealloc, /* tp_dealloc */

Modules/_sqlite/row.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ PyMappingMethods row_as_mapping = {
154154
PyTypeObject RowType = {
155155
PyObject_HEAD_INIT(NULL)
156156
0, /* ob_size */
157-
"pysqlite2.dbapi2.Row", /* tp_name */
157+
MODULE_NAME ".Row", /* tp_name */
158158
sizeof(Row), /* tp_basicsize */
159159
0, /* tp_itemsize */
160160
(destructor)row_dealloc, /* tp_dealloc */

Modules/_sqlite/statement.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ int check_remaining_sql(const char* tail)
381381
PyTypeObject StatementType = {
382382
PyObject_HEAD_INIT(NULL)
383383
0, /* ob_size */
384-
"pysqlite2.dbapi2.Statement", /* tp_name */
384+
MODULE_NAME ".Statement", /* tp_name */
385385
sizeof(Statement), /* tp_basicsize */
386386
0, /* tp_itemsize */
387387
(destructor)statement_dealloc, /* tp_dealloc */

PCbuild/_sqlite3.vcproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Name="VCCLCompilerTool"
2323
Optimization="0"
2424
AdditionalIncludeDirectories="..\Include;..\PC;..\..\sqlite-source-3.3.4"
25-
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;PYSQLITE_VERSION=\"2.2.0\""
25+
PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;MODULE_NAME=\"sqlite3\""
2626
RuntimeLibrary="3"
2727
UsePrecompiledHeader="2"
2828
WarningLevel="3"
@@ -77,7 +77,7 @@
7777
Optimization="2"
7878
InlineFunctionExpansion="1"
7979
AdditionalIncludeDirectories="..\Include;..\PC;..\..\sqlite-source-3.3.4"
80-
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PYSQLITE_VERSION=\"2.2.0\""
80+
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\"sqlite3\""
8181
StringPooling="TRUE"
8282
RuntimeLibrary="2"
8383
EnableFunctionLevelLinking="TRUE"
@@ -135,7 +135,7 @@
135135
Optimization="2"
136136
InlineFunctionExpansion="1"
137137
AdditionalIncludeDirectories="{MSSDKPATH}\include\Win64\atl;{MSSDKPATH}\include\Win64\crt;{MSSDKPATH}\include\Win64\crt\sys;{MSSDKPATH}\include\Win64\mfc;..\Include;..\PC;..\..\sqlite-source-3.3.4"
138-
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PYSQLITE_VERSION=\"2.2.0\""
138+
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\"sqlite3\""
139139
StringPooling="TRUE"
140140
BasicRuntimeChecks="0"
141141
RuntimeLibrary="2"
@@ -197,7 +197,7 @@
197197
Optimization="2"
198198
InlineFunctionExpansion="1"
199199
AdditionalIncludeDirectories="{MSSDKPATH}\include\Win64\atl\amd64;{MSSDKPATH}\include\Win64\crt\amd64;{MSSDKPATH}\include\Win64\crt\amd64\sys;{MSSDKPATH}\include\Win64\mfc\amd64;..\Include;..\PC;..\..\sqlite-source-3.3.4"
200-
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;PYSQLITE_VERSION=\"2.2.0\""
200+
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;MODULE_NAME=\"sqlite3\""
201201
StringPooling="TRUE"
202202
BasicRuntimeChecks="0"
203203
RuntimeLibrary="2"

0 commit comments

Comments
 (0)