third_party/waf: upgrade to waf 2.0.8
[bbaumbach/samba-autobuild/.git] / third_party / waf / waflib / Utils.py
index 0c9158385b40f73844c6059dfa55358f05912be8..b4665c4dc2bbf64fd723206b944a42ab8a5f03da 100644 (file)
@@ -1,7 +1,3 @@
-#! /usr/bin/env python
-# encoding: utf-8
-# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
-
 #!/usr/bin/env python
 # encoding: utf-8
 # Thomas Nagy, 2005-2018 (ita)
@@ -204,6 +200,8 @@ class lazy_generator(object):
                        it = self.it = self.fun(*self.params)
                return next(it)
 
+       next = __next__
+
 is_win32 = os.sep == '\\' or sys.platform == 'win32' # msys2
 """
 Whether this system is a Windows series
@@ -436,6 +434,21 @@ def to_list(val):
        else:
                return val
 
+def console_encoding():
+       try:
+               import ctypes
+       except ImportError:
+               pass
+       else:
+               try:
+                       codepage = ctypes.windll.kernel32.GetConsoleCP()
+               except AttributeError:
+                       pass
+               else:
+                       if codepage:
+                               return 'cp%d' % codepage
+       return sys.stdout.encoding or ('cp1252' if is_win32 else 'latin-1')
+
 def split_path_unix(path):
        return path.split('/')