Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-24464: Fix sqlite3.enable_shared_cache() deprecation wrapper #24170

Merged
merged 5 commits into from
Jan 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Lib/sqlite3/dbapi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def enable_shared_cache(enable):
"the cache=shared query parameter."
)
warnings.warn(msg, DeprecationWarning, stacklevel=2)
return _old_enable_shared_cache
return _old_enable_shared_cache(enable)

# Clean up namespace

Expand Down
4 changes: 4 additions & 0 deletions Lib/sqlite3/test/dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import threading
import unittest
import sqlite3 as sqlite
import sys

from test.support.os_helper import TESTFN, unlink

Expand Down Expand Up @@ -82,6 +83,9 @@ def test_not_supported_error(self):
sqlite.DatabaseError),
"NotSupportedError is not a subclass of DatabaseError")

# sqlite3_enable_shared_cache() is deprecated on macOS and calling it may raise
# OperationalError on some buildbots.
@unittest.skipIf(sys.platform == "darwin", "shared cache is deprecated on macOS")
def test_shared_cache_deprecated(self):
for enable in (True, False):
with self.assertWarns(DeprecationWarning) as cm:
Expand Down