diff --git a/qutebrowser/misc/crashdialog.py b/qutebrowser/misc/crashdialog.py index dbb473b4e..64cccde83 100644 --- a/qutebrowser/misc/crashdialog.py +++ b/qutebrowser/misc/crashdialog.py @@ -24,9 +24,8 @@ import sys import html import getpass import traceback -import distutils.version # pylint: disable=no-name-in-module,import-error -# https://bitbucket.org/logilab/pylint/issue/73/ +import pkg_resources from PyQt5.QtCore import pyqtSlot, Qt, QSize, qVersion from PyQt5.QtWidgets import (QDialog, QLabel, QTextEdit, QPushButton, QVBoxLayout, QHBoxLayout, QCheckBox, @@ -328,8 +327,8 @@ class _CrashDialog(QDialog): """ # pylint: disable=no-member # https://bitbucket.org/logilab/pylint/issue/73/ - new_version = distutils.version.StrictVersion(newest) - cur_version = distutils.version.StrictVersion(qutebrowser.__version__) + new_version = pkg_resources.parse_version(newest) + cur_version = pkg_resources.parse_version(qutebrowser.__version__) lines = ['The report has been sent successfully. Thanks!'] if new_version > cur_version: lines.append("Note: The newest available version is v{}, " diff --git a/qutebrowser/utils/qtutils.py b/qutebrowser/utils/qtutils.py index 6573306ab..8073b4bbb 100644 --- a/qutebrowser/utils/qtutils.py +++ b/qutebrowser/utils/qtutils.py @@ -31,10 +31,9 @@ import io import os import sys import operator -import distutils.version # pylint: disable=no-name-in-module,import-error -# https://bitbucket.org/logilab/pylint/issue/73/ import contextlib +import pkg_resources from PyQt5.QtCore import (qVersion, QEventLoop, QDataStream, QByteArray, QIODevice, QSaveFile) from PyQt5.QtWidgets import QApplication @@ -60,8 +59,8 @@ def version_check(version, op=operator.ge): """ # pylint: disable=no-member # https://bitbucket.org/logilab/pylint/issue/73/ - return op(distutils.version.StrictVersion(qVersion()), - distutils.version.StrictVersion(version)) + return op(pkg_resources.parse_version(qVersion()), + pkg_resources.parse_version(version)) def check_overflow(arg, ctype, fatal=True):