]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131712: Build _suggestions extension on Windows (#131759)
authorVictor Stinner <vstinner@python.org>
Thu, 27 Mar 2025 08:53:39 +0000 (09:53 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Mar 2025 08:53:39 +0000 (09:53 +0100)
Add a test checking that the '_suggestions' extension is available.

Lib/test/test_traceback.py
PC/config.c

index 68c4fa117a90f55641fba32de65cce012e4ac9d9..ac492782cb1a5c8497e3cf95b93baf19d9dc7c84 100644 (file)
@@ -4616,6 +4616,12 @@ class MiscTest(unittest.TestCase):
                 res3 = traceback._levenshtein_distance(a, b, threshold)
                 self.assertGreater(res3, threshold, msg=(a, b, threshold))
 
+    @cpython_only
+    def test_suggestions_extension(self):
+        # Check that the C extension is available
+        import _suggestions  # noqa: F401
+
+
 class TestColorizedTraceback(unittest.TestCase):
     def test_colorized_traceback(self):
         def foo(*args):
index b744f711b0d6363c21229768089899b523cc5c38..873f93063057dccdf1e98d6e5713e8205f3a0112 100644 (file)
@@ -77,6 +77,7 @@ extern PyObject* PyInit__stat(void);
 extern PyObject* PyInit__opcode(void);
 extern PyObject* PyInit__contextvars(void);
 extern PyObject* PyInit__tokenize(void);
+extern PyObject* PyInit__suggestions(void);
 
 /* tools/freeze/makeconfig.py marker for additional "extern" */
 /* -- ADDMODULE MARKER 1 -- */
@@ -137,6 +138,7 @@ struct _inittab _PyImport_Inittab[] = {
     {"_datetime", PyInit__datetime},
     {"_functools", PyInit__functools},
     {"_json", PyInit__json},
+    {"_suggestions", PyInit__suggestions},
 
     {"xxsubtype", PyInit_xxsubtype},
     {"_interpreters", PyInit__interpreters},