From 9de809ee9829cc9e519129a52e1607a34ad589f5 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 28 Nov 2020 13:18:30 +0100 Subject: [PATCH] webconfig: Remove LooseVersion This writes super cheesy version checking, but allows us to remove distutils. Fixes #7514. Hat tip @zanchey for the check. --- share/tools/web_config/webconfig.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/tools/web_config/webconfig.py b/share/tools/web_config/webconfig.py index e724ced48..763cda13b 100755 --- a/share/tools/web_config/webconfig.py +++ b/share/tools/web_config/webconfig.py @@ -7,7 +7,6 @@ try: from html import escape as escape_html except ImportError: from cgi import escape as escape_html -from distutils.version import LooseVersion import glob import multiprocessing.pool import operator @@ -44,8 +43,10 @@ def find_executable(exe): def isMacOS10_12_5_OrLater(): """ Return whether this system is macOS 10.12.5 or a later version. """ - version = platform.mac_ver()[0] - return version and LooseVersion(version) >= LooseVersion("10.12.5") + try: + return [int(x) for x in platform.mac_ver()[0].split(".")] >= [10, 12, 5] + except: + return False def is_wsl():