summaryrefslogtreecommitdiffstats
path: root/waflib/Utils.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 17:31:03 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 18:14:27 +0100
commitdc15972a98d7b60bd81f9a6b456ecccaeb7c654d (patch)
tree1bb62d4a902388d4a0440c4524ab838a03aee9ea /waflib/Utils.py
parentccc9b971ab206fa3dc32a432a3e76db976192f58 (diff)
parent8cb9c6430dc0056f8d40b4d8e0bdc616ff397e1f (diff)
downloadganv-dc15972a98d7b60bd81f9a6b456ecccaeb7c654d.tar.gz
ganv-dc15972a98d7b60bd81f9a6b456ecccaeb7c654d.tar.bz2
ganv-dc15972a98d7b60bd81f9a6b456ecccaeb7c654d.zip
Update autowaf and adapt to new API
Diffstat (limited to 'waflib/Utils.py')
-rw-r--r--waflib/Utils.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/waflib/Utils.py b/waflib/Utils.py
index b4665c4..4b808a8 100644
--- a/waflib/Utils.py
+++ b/waflib/Utils.py
@@ -49,10 +49,16 @@ try:
from hashlib import md5
except ImportError:
try:
- from md5 import md5
+ from hashlib import sha1 as md5
except ImportError:
- # never fail to enable fixes from another module
+ # never fail to enable potential fixes from another module
pass
+else:
+ try:
+ md5().digest()
+ except ValueError:
+ # Fips? #2213
+ from hashlib import sha1 as md5
try:
import threading
@@ -202,7 +208,7 @@ class lazy_generator(object):
next = __next__
-is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2
+is_win32 = os.sep == '\\' or sys.platform == 'win32' or os.name == 'nt' # msys2
"""
Whether this system is a Windows series
"""
@@ -484,7 +490,9 @@ def split_path_msys(path):
if sys.platform == 'cygwin':
split_path = split_path_cygwin
elif is_win32:
- if os.environ.get('MSYSTEM'):
+ # Consider this an MSYSTEM environment if $MSYSTEM is set and python
+ # reports is executable from a unix like path on a windows host.
+ if os.environ.get('MSYSTEM') and sys.executable.startswith('/'):
split_path = split_path_msys
else:
split_path = split_path_win32
@@ -730,7 +738,7 @@ def unversioned_sys_platform():
if s == 'cli' and os.name == 'nt':
# ironpython is only on windows as far as we know
return 'win32'
- return re.split('\d+$', s)[0]
+ return re.split(r'\d+$', s)[0]
def nada(*k, **kw):
"""