Skip to content

Commit 2794d9a

Browse files
committed
Fix regexp following a change in error message (Python 3.14)
1 parent 185f5e7 commit 2794d9a

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

didyoumean/didyoumean_internal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def suggest_feature_not_supported(attr, type_str, frame):
555555
for s in suggest_attribute_alternative(attr, type_str, attributes):
556556
yield s
557557
if type_str not in frame.f_builtins and \
558-
type_str not in ('function', 'generator'):
558+
type_str not in ('function', 'generator', 'builtin_function_or_method'):
559559
yield 'implement "' + attr + '" on ' + type_str
560560

561561

didyoumean/didyoumean_re.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
r"(?:object but received|objects doesn't apply to) (?:a )?" \
126126
r"'({0})'(?:| object)$".format(TYPE_NAME)
127127
ARG_NOT_ITERABLE_RE = r"^(?:argument of type )?'({0})'" \
128-
r"(?: object)? is not iterable$".format(TYPE_NAME)
128+
r"(?: object)? is not (a container or )?iterable$".format(TYPE_NAME)
129129
MUST_BE_CALLED_WITH_INST_RE = r"^unbound method (\w+)\(\) must be called " \
130130
r"with ({0}) instance as first argument " \
131131
r"\(got ({0}) instance instead\)$".format(TYPE_NAME)

didyoumean/didyoumean_re_tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ def test_argument_not_iterable(self):
765765
msgs = [
766766
# Python 2.6/2.7/3.2/3.3/3.4/3.5
767767
"argument of type 'type' is not iterable",
768+
# Python 3.14
769+
"argument of type 'type' is not a container or iterable",
768770
# PyPy/PyPy3
769771
"'type' object is not iterable"
770772
]

0 commit comments

Comments
 (0)