Skip to content

Commit 4bb399d

Browse files
committed
Fix name collision / shadowing
1 parent 38b13e5 commit 4bb399d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Lib/pydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class or function within a module or module in a package. If the
5454
# path will be displayed.
5555

5656
import ast
57-
import token
5857
import __future__
5958
import builtins
6059
import importlib._bootstrap
@@ -77,6 +76,7 @@ class or function within a module or module in a package. If the
7776
from collections import deque
7877
from reprlib import Repr
7978
from traceback import format_exception_only
79+
from token import tok_name
8080

8181
from _pyrepl.pager import (get_pager, pipe_pager,
8282
plain_pager, tempfile_pager, tty_pager)
@@ -400,7 +400,7 @@ def source_synopsis(file):
400400

401401
# tokenize always returns at least ENCODING and ENDMARKER
402402
for token in tokens:
403-
token_name = token.tok_name[token.type]
403+
token_name = tok_name[token.type]
404404
if token.name not in {'COMMENT', 'NL', 'ENCODING'}:
405405
break
406406

0 commit comments

Comments
 (0)