mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
[Bug #758665] cgitb.scanvars() fails because of an unititialized value variable. Patch from Robin Becker.
This commit is contained in:
parent
94afd3e7ae
commit
26f6bdf4f1
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ def lookup(name, frame, locals):
|
|||
def scanvars(reader, frame, locals):
|
||||
"""Scan one logical line of Python and look up values of variables used."""
|
||||
import tokenize, keyword
|
||||
vars, lasttoken, parent, prefix = [], None, None, ''
|
||||
vars, lasttoken, parent, prefix, value = [], None, None, '', __UNDEF__
|
||||
for ttype, token, start, end, line in tokenize.generate_tokens(reader):
|
||||
if ttype == tokenize.NEWLINE: break
|
||||
if ttype == tokenize.NAME and token not in keyword.kwlist:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue