diff --git a/linkcheck/better_exchook2.py b/linkcheck/better_exchook2.py index f4a5dee6..fa172d73 100644 --- a/linkcheck/better_exchook2.py +++ b/linkcheck/better_exchook2.py @@ -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) diff --git a/linkcheck/command/setup_config.py b/linkcheck/command/setup_config.py index 41007213..18e7946e 100644 --- a/linkcheck/command/setup_config.py +++ b/linkcheck/command/setup_config.py @@ -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") diff --git a/linkcheck/plugins/parseword.py b/linkcheck/plugins/parseword.py index feb6e1d9..cd3d8049 100644 --- a/linkcheck/plugins/parseword.py +++ b/linkcheck/plugins/parseword.py @@ -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: