Skip to content

Commit f8b3e7b

Browse files
committed
Fix regexp following a change in error message (Python 3.14.1)
Remaining error to be investigated (regression in 3.14.1 ?)
1 parent 6201fe8 commit f8b3e7b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

didyoumean/didyoumean_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
ZERO_LEN_FIELD_RE = r"^zero length field name in format$"
5959
MATH_DOMAIN_ERROR_RE = r"^math domain error$"
6060
TOO_MANY_VALUES_UNPACK_RE = r"^too many values " \
61-
r"to unpack(?: \(expected \d+\))?$"
61+
r"to unpack(?: \(expected.*\))?$"
6262
OUTSIDE_FUNCTION_RE = r"^'?(\w+)'? outside function$"
6363
NEED_MORE_VALUES_RE = r"^(?:need more than \d+|not enough) values to unpack" \
6464
r"(?: \(expected \d+, got \d+\))?$"

didyoumean/didyoumean_re_tests.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def test_type_name(self):
120120
'int',
121121
'method-wrapper',
122122
'builtin_function',
123-
'builtin_function_or_method'
123+
'builtin_function_or_method',
124+
'_io.TextIOWrapper'
124125
] + list(real_types)
125126
for type_ in types:
126127
if type_ not in ('symtable entry', 'builtin method', 'Counter optimizer'):
@@ -380,6 +381,8 @@ def test_too_many_values(self):
380381
"too many values to unpack",
381382
# Python 3.2/3.3/3.4/3.5/PyPy3
382383
"too many values to unpack (expected 3)",
384+
# Python 3.14.1
385+
"too many values to unpack (expected 3, got 4)"
383386
]
384387
for msg in msgs:
385388
self.re_matches(msg, re.TOO_MANY_VALUES_UNPACK_RE, NO_GROUP)

0 commit comments

Comments
 (0)