]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-24464: Fix sqlite3.enable_shared_cache() deprecation wrapper (GH-24170)
authorErlend Egeberg Aasland <erlend.aasland@innova.no>
Sat, 9 Jan 2021 11:25:55 +0000 (12:25 +0100)
committerGitHub <noreply@github.com>
Sat, 9 Jan 2021 11:25:55 +0000 (13:25 +0200)
Lib/sqlite3/dbapi2.py
Lib/sqlite3/test/dbapi.py

index 6475f98a646f9e62085066edae0750f51457062b..cfe6225f46efc0ab6a82474de33499bfc909610e 100644 (file)
@@ -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
 
index 68a3062239532528a14721b8575a585a4e1ffc16..39c9bf5b61143db5f221d1e0b4fe0509d5d86d75 100644 (file)
@@ -23,6 +23,7 @@
 import threading
 import unittest
 import sqlite3 as sqlite
+import sys
 
 from test.support.os_helper import TESTFN, unlink
 
@@ -82,6 +83,9 @@ class ModuleTests(unittest.TestCase):
                                    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: