Skip to content

Commit 5c0be8c

Browse files
[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 9ef9d68) Co-authored-by: Victor Stinner <[email protected]>
1 parent b0f3876 commit 5c0be8c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Lib/test/test_traceback.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4612,6 +4612,12 @@ def test_levenshtein_distance_short_circuit(self):
46124612
res3 = traceback._levenshtein_distance(a, b, threshold)
46134613
self.assertGreater(res3, threshold, msg=(a, b, threshold))
46144614

4615+
@cpython_only
4616+
def test_suggestions_extension(self):
4617+
# Check that the C extension is available
4618+
import _suggestions # noqa: F401
4619+
4620+
46154621
class TestColorizedTraceback(unittest.TestCase):
46164622
def test_colorized_traceback(self):
46174623
def foo(*args):

PC/config.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ extern PyObject* PyInit__stat(void);
7777
extern PyObject* PyInit__opcode(void);
7878
extern PyObject* PyInit__contextvars(void);
7979
extern PyObject* PyInit__tokenize(void);
80+
extern PyObject* PyInit__suggestions(void);
8081

8182
/* tools/freeze/makeconfig.py marker for additional "extern" */
8283
/* -- ADDMODULE MARKER 1 -- */
@@ -137,6 +138,7 @@ struct _inittab _PyImport_Inittab[] = {
137138
{"_datetime", PyInit__datetime},
138139
{"_functools", PyInit__functools},
139140
{"_json", PyInit__json},
141+
{"_suggestions", PyInit__suggestions},
140142

141143
{"xxsubtype", PyInit_xxsubtype},
142144
{"_interpreters", PyInit__interpreters},

0 commit comments

Comments
 (0)