@@ -233,7 +233,7 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
233233
234234 /* Clean up if user has not called .close() explicitly. */
235235 if (self -> db ) {
236- SQLITE3_CLOSE (self -> db );
236+ sqlite3_close_v2 (self -> db );
237237 }
238238
239239 Py_XDECREF (self -> isolation_level );
@@ -338,7 +338,7 @@ pysqlite_connection_close_impl(pysqlite_Connection *self)
338338 pysqlite_do_all_statements (self , ACTION_FINALIZE , 1 );
339339
340340 if (self -> db ) {
341- rc = SQLITE3_CLOSE (self -> db );
341+ rc = sqlite3_close_v2 (self -> db );
342342
343343 if (rc != SQLITE_OK ) {
344344 _pysqlite_seterror (self -> db , NULL );
@@ -1687,33 +1687,7 @@ pysqlite_connection_backup_impl(pysqlite_Connection *self,
16871687 if (rc == SQLITE_NOMEM ) {
16881688 (void )PyErr_NoMemory ();
16891689 } else {
1690- #if SQLITE_VERSION_NUMBER > 3007015
16911690 PyErr_SetString (pysqlite_OperationalError , sqlite3_errstr (rc ));
1692- #else
1693- switch (rc ) {
1694- case SQLITE_ERROR :
1695- /* Description of SQLITE_ERROR in SQLite 3.7.14 and older
1696- releases. */
1697- PyErr_SetString (pysqlite_OperationalError ,
1698- "SQL logic error or missing database" );
1699- break ;
1700- case SQLITE_READONLY :
1701- PyErr_SetString (pysqlite_OperationalError ,
1702- "attempt to write a readonly database" );
1703- break ;
1704- case SQLITE_BUSY :
1705- PyErr_SetString (pysqlite_OperationalError , "database is locked" );
1706- break ;
1707- case SQLITE_LOCKED :
1708- PyErr_SetString (pysqlite_OperationalError ,
1709- "database table is locked" );
1710- break ;
1711- default :
1712- PyErr_Format (pysqlite_OperationalError ,
1713- "unrecognized error code: %d" , rc );
1714- break ;
1715- }
1716- #endif
17171691 }
17181692 }
17191693
0 commit comments