diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-21 08:30:52 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-06-21 08:30:52 +0200 |
commit | 2b97dfcf16c592c62ec9d4ac671efc1d6ca3134f (patch) | |
tree | 0ed735a7e97826d7619b3f3dd3eb3d1a958e78d8 /pylint/checkers/classes.py | |
parent | 61fa3eceb32d8f176618f65d20fcd4227cce6979 (diff) | |
download | pylint-git-2b97dfcf16c592c62ec9d4ac671efc1d6ca3134f.tar.gz |
Use as_string() to get the representation of an annotation, not name, which can be missing. Close #2210
Diffstat (limited to 'pylint/checkers/classes.py')
-rw-r--r-- | pylint/checkers/classes.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pylint/checkers/classes.py b/pylint/checkers/classes.py index b80b05eac..55a03a02f 100644 --- a/pylint/checkers/classes.py +++ b/pylint/checkers/classes.py @@ -875,7 +875,7 @@ a metaclass class method.'} if meth_node is not None: def form_annotations(annotations): - return [a.name if a is not None else a for a in annotations] + return [annotation.as_string() for annotation in filter(None, annotations)] called_annotations = form_annotations(function.args.annotations) overridden_annotations = form_annotations(meth_node.args.annotations) if called_annotations and overridden_annotations: |