diff options
Diffstat (limited to 'third_party/waf/waflib/Utils.py')
-rw-r--r-- | third_party/waf/waflib/Utils.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/third_party/waf/waflib/Utils.py b/third_party/waf/waflib/Utils.py index 0c9158385b4..b4665c4dc2b 100644 --- a/third_party/waf/waflib/Utils.py +++ b/third_party/waf/waflib/Utils.py @@ -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('/') |