Skip to content

Commit a3a8d6d

Browse files
committed
Omit session code when session is not enabled
Fixes #565
1 parent 4e97916 commit a3a8d6d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/connection.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,10 @@ Connection_remove_dependent(Connection *self, PyObject *o)
247247
}
248248
}
249249

250+
#ifdef SQLITE_ENABLE_SESSION
250251
static PyTypeObject APSWSessionType;
251252
static PyTypeObject APSWChangesetBuilderType;
253+
#endif
252254

253255
/* returns zero on success, non-zero on error */
254256
static int
@@ -276,10 +278,12 @@ Connection_close_internal(Connection *self, int force)
276278
if (vargs[2])
277279
{
278280
int nargs = 2;
281+
#ifdef SQLITE_ENABLE_SESSION
279282
/* these don't have force parameter */
280283
if (PyObject_IsInstance(item, (PyObject *)&APSWSessionType)
281284
|| PyObject_IsInstance(item, (PyObject *)&APSWChangesetBuilderType))
282285
nargs = 1;
286+
#endif
283287
closeres = PyObject_VectorcallMethod(apst.close, vargs + 1, nargs | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
284288
}
285289
Py_XDECREF(vargs[2]);

0 commit comments

Comments
 (0)