mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-16 22:10:26 +00:00
Fix errors found by Pylint
Remove code for old-style classes:
better_exchook2.py:238:62: E1101: Module 'types' has no 'InstanceType' member (no-member)
Command-line equivalent of 9a33c2a65 ("Make requesting login form password work on Python 3", 2020-04-14):
command/setup_config.py:167:36: E1101: Module 'linkcheck.director.console' has no 'encode' member (no-member)
Add missing argument:
plugins/parseword.py:141:31: E1120: No value for argument 'wrange' in function call (no-value-for-parameter)
This commit is contained in:
parent
60c4e7b671
commit
1341ee92bc
3 changed files with 3 additions and 6 deletions
|
|
@ -234,9 +234,7 @@ def better_exchook(etype, value, tb, out=sys.stdout):
|
|||
else:
|
||||
line = f"{etype}: {valuestr}"
|
||||
return line
|
||||
if (isinstance(etype, BaseException) or
|
||||
(hasattr(types, "InstanceType") and isinstance(etype, types.InstanceType)) or
|
||||
etype is None or type(etype) is str):
|
||||
if isinstance(etype, BaseException) or etype is None or type(etype) is str:
|
||||
output(_format_final_exc_line(etype, value), out=out)
|
||||
else:
|
||||
output(_format_final_exc_line(etype.__name__, value), out=out)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ from .. import LOG_CMDLINE
|
|||
from .. import get_link_pat, log
|
||||
|
||||
from ..cmdline import print_version, print_usage, print_plugins
|
||||
from ..director import console
|
||||
|
||||
|
||||
def has_encoding(encoding):
|
||||
|
|
@ -164,7 +163,7 @@ def setup_config(config, options):
|
|||
}
|
||||
else:
|
||||
msg = _("Enter LinkChecker HTTP/FTP password:")
|
||||
_password = getpass.getpass(console.encode(msg))
|
||||
_password = getpass.getpass(msg)
|
||||
constructauth = True
|
||||
if options.quiet:
|
||||
config["logger"] = config.logger_new("none")
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class WordParser(_ParserPlugin):
|
|||
raise Error("could not open word file %r" % filename)
|
||||
try:
|
||||
for link in doc.Hyperlinks:
|
||||
line = get_line_number(link.Range)
|
||||
line = get_line_number(doc, link.Range)
|
||||
name = link.TextToDisplay
|
||||
url_data.add_url(link.Address, name=name, line=line)
|
||||
finally:
|
||||
|
|
|
|||
Loading…
Reference in a new issue