From a223937624e2331adabb56b6ff703b220657fc5c Mon Sep 17 00:00:00 2001 From: Markus Neteler Date: Tue, 21 Feb 2023 15:24:49 +0100 Subject: [PATCH] Fix Travis: ModuleNotFoundError: No module named 'six' (releasebranch_8_2) Currently Travis CI fails in `releasebranch_8_2`: ``` Traceback (most recent call last): File "/home/travis/build/OSGeo/grass/dist.x86_64-pc-linux-gnu/utils/mkhtml.py", line 37, in from six.moves.urllib import request as urlrequest ModuleNotFoundError: No module named 'six' ``` (Example for a failed Travis run: https://github.com/OSGeo/grass/pull/2843/checks?check_run_id=11475577650) This PR addresses the removal of `six` in a simple way. Side note: Travis does not fail in `main` due to PR #2547, https://github.com/OSGeo/grass/commit/17fc1d8dfd5f07ac88611d22727dfd0e40cd646f#diff-3e1684c5c5d40b273b6488a9b5a5558f556d2bcf2973ba5106b6125e01aa6959 --- utils/mkhtml.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/utils/mkhtml.py b/utils/mkhtml.py index 0f34c2ebe4b..56f72e5eb1b 100644 --- a/utils/mkhtml.py +++ b/utils/mkhtml.py @@ -34,8 +34,12 @@ # Python 3 import from html.parser import HTMLParser -from six.moves.urllib import request as urlrequest -from six.moves.urllib.error import HTTPError, URLError +try: + from six.moves.urllib import request as urlrequest + from six.moves.urllib.error import HTTPError, URLError +except ImportError: + from urllib import request as urlrequest + from urllib.error import HTTPError, URLError try: import urlparse