https://github.com/python/cpython/commit/5c0be8ced6fcdb4372eb946ce816c4f689f2917b
commit: 5c0be8ced6fcdb4372eb946ce816c4f689f2917b
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: vstinner <vstin...@python.org>
date: 2025-03-27T09:19:46Z
summary:

[3.13] gh-131712: Build _suggestions extension on Windows (GH-131759) (#131790)

gh-131712: Build _suggestions extension on Windows (GH-131759)

Add a test checking that the '_suggestions' extension is available.
(cherry picked from commit 9ef9d687ff7cfc4bbf422ba61db04207b7f343d2)

Co-authored-by: Victor Stinner <vstin...@python.org>

files:
M Lib/test/test_traceback.py
M PC/config.c

diff --git a/Lib/test/test_traceback.py b/Lib/test/test_traceback.py
index d104402f2fd62a..adc413d47d662c 100644
--- a/Lib/test/test_traceback.py
+++ b/Lib/test/test_traceback.py
@@ -4612,6 +4612,12 @@ def test_levenshtein_distance_short_circuit(self):
                 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):
diff --git a/PC/config.c b/PC/config.c
index b744f711b0d636..873f93063057dc 100644
--- a/PC/config.c
+++ b/PC/config.c
@@ -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},

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to