diff options
Diffstat (limited to 'astroid/helpers.py')
| -rw-r--r-- | astroid/helpers.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/astroid/helpers.py b/astroid/helpers.py index a35635e8..b4ead8eb 100644 --- a/astroid/helpers.py +++ b/astroid/helpers.py @@ -142,7 +142,7 @@ def object_issubclass(node, class_or_seq, context=None): or its type's mro doesn't work """ if not isinstance(node, nodes.ClassDef): - raise TypeError("{node} needs to be a ClassDef node".format(node=node)) + raise TypeError(f"{node} needs to be a ClassDef node") return _object_type_is_subclass(node, class_or_seq, context=context) @@ -286,7 +286,7 @@ def object_len(node, context=None): len_call = next(node_type.igetattr("__len__", context=context)) except exceptions.AttributeInferenceError as e: raise exceptions.AstroidTypeError( - "object of type '{}' has no len()".format(node_type.pytype()) + f"object of type '{node_type.pytype()}' has no len()" ) from e result_of_len = next(len_call.infer_call_result(node, context)) @@ -301,5 +301,5 @@ def object_len(node, context=None): # Fake a result as we don't know the arguments of the instance call. return 0 raise exceptions.AstroidTypeError( - "'{}' object cannot be interpreted as an integer".format(result_of_len) + f"'{result_of_len}' object cannot be interpreted as an integer" ) |
