diff options
author | Georg Brandl <georg@python.org> | 2006-05-29 14:39:00 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-05-29 14:39:00 (GMT) |
commit | 47dc1182470a5479025e654b173cdd4bb983e450 (patch) | |
tree | 39afe0d30cbb16e935057fb9836b30f1e3886e8d /Lib/pyclbr.py | |
parent | 80181e2b7871fb1d4f5fc8bc302db0e7e460d858 (diff) | |
download | cpython-47dc1182470a5479025e654b173cdd4bb983e450.zip cpython-47dc1182470a5479025e654b173cdd4bb983e450.tar.gz cpython-47dc1182470a5479025e654b173cdd4bb983e450.tar.bz2 |
Fix #1494787 (pyclbr counts whitespace as superclass name)
Diffstat (limited to 'Lib/pyclbr.py')
-rw-r--r-- | Lib/pyclbr.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/pyclbr.py b/Lib/pyclbr.py index 0812e22..0731224 100644 --- a/Lib/pyclbr.py +++ b/Lib/pyclbr.py @@ -42,7 +42,7 @@ Instances of this class have the following instance variables: import sys import imp import tokenize # Python tokenizer -from token import NAME, DEDENT, NEWLINE +from token import NAME, DEDENT, NEWLINE, OP from operator import itemgetter __all__ = ["readmodule", "readmodule_ex", "Class", "Function"] @@ -219,8 +219,10 @@ def _readmodule(module, path, inpackage=None): break elif token == ',' and level == 1: pass - else: + # only use NAME and OP (== dot) tokens for type name + elif tokentype in (NAME, OP) and level == 1: super.append(token) + # expressions in the base list are not supported inherit = names cur_class = Class(fullmodule, class_name, inherit, file, lineno) if not stack: |