8000 Address review · python/cpython@dd2ffde · GitHub
[go: up one dir, main page]

Skip to content

Commit dd2ffde

Browse files
Erlend Egeberg Aaslandzooba
andcommitted
Address review
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
1 parent 62e2d6b commit dd2ffde

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

Lib/test/audit-tests.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,14 @@ def hook(event, *args):
370370
cx = sqlite3.connect(":memory:")
371371

372372
# Configured without --enable-loadable-sqlite-extensions
373-
if not hasattr(sqlite3.Connection, "enable_load_extension"):
374-
return
375-
376-
cx.enable_load_extension(False)
377-
try:
378-
cx.load_extension("test")
379-
except sqlite3.OperationalError:
380-
pass
381-
else:
382-
raise RuntimeError("Expected sqlite3.load_extension to fail")
373+
if hasattr(sqlite3.Connection, "enable_load_extension"):
374+
cx.enable_load_extension(False)
375+
try:
376+
cx.load_extension("test")
377+
except sqlite3.OperationalError:
378+
pass
379+
else:
380+
raise RuntimeError("Expected sqlite3.load_extension to fail")
383381

384382

385383
if __name__ == "__main__":

Modules/_sqlite/connection.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ pysqlite_connection_enable_load_extension_impl(pysqlite_Connection *self,
11541154
{
11551155
int rc;
11561156

1157-
if (PySys_Audit("sqlite3.enable_load_extension", "i", onoff) < 0) {
1157+
if (PySys_Audit("sqlite3.enable_load_extension", "O", onoff ? Py_True : Py_False) < 0) {
11581158
return NULL;
11591159
}
11601160

0 commit comments

Comments
 (0)
0