mirror of https://github.com/python/cpython
Fix suggested by Magnus Kessler: in class Page, it is possible for
self.parser to be None; in that case don't dereference it in getnames().
This commit is contained in:
parent
a80649b357
commit
84306246f1
|
@ -681,7 +681,10 @@ class Page:
|
|||
|
||||
# Method to retrieve names.
|
||||
def getnames(self):
|
||||
return self.parser.names
|
||||
if self.parser:
|
||||
return self.parser.names
|
||||
else:
|
||||
return []
|
||||
|
||||
def getlinkinfos(self):
|
||||
# File reading is done in __init__() routine. Store parser in
|
||||
|
|
Loading…
Reference in New Issue