Skip to content

Commit 4a64331

Browse files
authored
sqlite3 updates for py312 (#10469)
1 parent 57c435c commit 4a64331

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

stdlib/sqlite3/dbapi2.pyi

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ def connect(
233233
) -> Connection: ...
234234
def enable_callback_tracebacks(__enable: bool) -> None: ...
235235

236-
# takes a pos-or-keyword argument because there is a C wrapper
237-
def enable_shared_cache(enable: int) -> None: ...
236+
if sys.version_info < (3, 12):
237+
# takes a pos-or-keyword argument because there is a C wrapper
238+
def enable_shared_cache(enable: int) -> None: ...
238239

239240
if sys.version_info >= (3, 10):
240241
def register_adapter(__type: type[_T], __adapter: _Adapter[_T]) -> None: ...
@@ -298,6 +299,11 @@ class Connection:
298299
isolation_level: str | None # one of '', 'DEFERRED', 'IMMEDIATE' or 'EXCLUSIVE'
299300
@property
300301
def total_changes(self) -> int: ...
302+
if sys.version_info >= (3, 12):
303+
@property
304+
def autocommit(self) -> int: ...
305+
@autocommit.setter
306+
def autocommit(self, val: int) -> None: ...
301307
row_factory: Any
302308
text_factory: Any
303309
def __init__(
@@ -375,6 +381,9 @@ class Connection:
375381
def getlimit(self, __category: int) -> int: ...
376382
def serialize(self, *, name: str = "main") -> bytes: ...
377383
def deserialize(self, __data: ReadableBuffer, *, name: str = "main") -> None: ...
384+
if sys.version_info >= (3, 12):
385+
def getconfig(self, __op: int) -> bool: ...
386+
def setconfig(self, __op: int, __enable: bool = True) -> bool: ...
378387

379388
def __call__(self, __sql: str) -> _Statement: ...
380389
def __enter__(self) -> Self: ...

tests/stubtest_allowlists/py312.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,14 +74,6 @@ posixpath.isjunction
7474
posixpath.splitroot
7575
smtplib.SMTP.starttls
7676
smtplib.SMTP_SSL.__init__
77-
sqlite3.Connection.autocommit
78-
sqlite3.Connection.getconfig
79-
sqlite3.Connection.setconfig
80-
sqlite3.dbapi2.Connection.autocommit
81-
sqlite3.dbapi2.Connection.getconfig
82-
sqlite3.dbapi2.Connection.setconfig
83-
sqlite3.dbapi2.enable_shared_cache
84-
sqlite3.enable_shared_cache
8577
sre_parse.Tokenizer.checkgroupname
8678
sre_parse.expand_template
8779
sre_parse.parse_template

0 commit comments

Comments
 (0)