diff options
author | Simo Fält <simo.falt@qt.io> | 2020-11-30 12:42:04 +0200 |
---|---|---|
committer | Simo Fält <simo.falt@qt.io> | 2020-11-30 12:52:15 +0000 |
commit | 6635c196f3813f722c3498ecd98a4fbf4bf14741 (patch) | |
tree | eedfd7daf265a6e7a18626f631d73e6e4324f910 /build_scripts | |
parent | 549c5a731370a20bf36d0bd5428414c5488eeca9 (diff) |
Allow calling CI's build scripts with python2
Currently we can't be sure that python3 is a default
python in all CI nodes.
Change-Id: I58ba7d2bb2dd987d344709c296ee3c5bc5c9c376
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py index b0a034c29..af126cca6 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -48,7 +48,13 @@ import fnmatch import itertools import glob -import urllib.request as urllib +# There is no urllib.request in Python2 +# even if Qt for Python doesn't support python2, we need the support for calling the +# build scipts with python2. +try: + import urllib.request as urllib +except ImportError: + import urllib import distutils.log as log from distutils.errors import DistutilsSetupError |