diff --git a/linkcheck/__init__.py b/linkcheck/__init__.py index 91cfbebd..f51c9d85 100644 --- a/linkcheck/__init__.py +++ b/linkcheck/__init__.py @@ -19,13 +19,9 @@ Main function module for link checking. # version checks import sys -# Needs Python >= 2.7 because we use dictionary based logging config -# Needs Python >= 2.7.2 which fixed http://bugs.python.org/issue11467 -if not (hasattr(sys, 'version_info') or - sys.version_info < (2, 7, 2, 'final', 0)): +if sys.version_info < (3, 5, 0, 'final', 0): import platform - version = platform.python_version() - raise SystemExit("This program requires Python 2.7.2 or later instead of %s." % version) + raise SystemExit("This program requires Python 3.5.0 or later instead of %s." % platform.python_version()) # require a reasonably recent requests module: 2.4.0 from 2014-08-29 import requests # PEP 396 has only version strings, bummer! PEP 386 is also not helpful. diff --git a/linkchecker b/linkchecker index 3073f13c..2efcaa09 100755 --- a/linkchecker +++ b/linkchecker @@ -1,4 +1,4 @@ -#!/usr/bin/python -Ru +#!/usr/bin/python3 -u # Copyright (C) 2000-2014 Bastian Kleineidam # # This program is free software; you can redistribute it and/or modify @@ -578,13 +578,12 @@ else: if do_profile: if has_profile: if os.path.exists(_profile): - question = _("""Overwrite profiling file %(file)r? -Press Ctrl-C to cancel, RETURN to continue.""") % {"file": _profile} + print(_("""Overwrite profiling file %(file)r? +Press Ctrl-C to cancel, RETURN to continue.""") % {"file": _profile}) try: - raw_input(question.encode(i18n.default_encoding, 'replace')) + input() except KeyboardInterrupt: - print >> sys.stderr - print >> sys.stderr, _("Canceled.") + print("", _("Canceled."), file=sys.stderr, sep="\n") sys.exit(1) else: log.warn(LOG_CMDLINE, diff --git a/setup.py b/setup.py index 7871f41f..8a1bb1fe 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ import stat import glob # import Distutils stuff -from setuptools import setup +from setuptools import find_packages, setup from distutils.command.install_lib import install_lib from distutils.command.sdist import sdist from distutils.command.clean import clean @@ -373,19 +373,7 @@ setup( 'clean': MyClean, 'sdist': MySdist, }, - packages = [ - 'linkcheck', - 'linkcheck.bookmarks', - 'linkcheck.cache', - 'linkcheck.checker', - 'linkcheck.configuration', - 'linkcheck.director', - 'linkcheck.htmlutil', - 'linkcheck.logger', - 'linkcheck.network', - 'linkcheck.parser', - 'linkcheck.plugins', - ], + packages = find_packages(include=["linkcheck", "linkcheck.*"]), scripts = scripts, data_files = data_files, classifiers = [