From 8e6db773b89ed9c9875b089c3fbbc0f3de7ae0fc Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 22 Oct 2020 17:33:18 +0800 Subject: [PATCH] fix for non-win32 platforms --- setup.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 3b89e86c9b..a6cc57c47b 100755 --- a/setup.py +++ b/setup.py @@ -60,11 +60,6 @@ except Exception: pass from optparse import OptionParser -if(sys.version_info.major >= 3): - import winreg as _winreg -else: - import _winreg - COCOS_RE_ROOT = 'COCOS_RE_ROOT' COCOS_RE_CONSOLE_ROOT = 'COCOS_RE_CONSOLE_ROOT' @@ -688,6 +683,12 @@ if __name__ == '__main__': # set environment variables env = SetEnvVar() + if env._isWindows(): + if(sys.version_info.major >= 3): + import winreg as _winreg + else: + import _winreg + env.set_environment_variables( opts.ndk_root, opts.android_sdk_root, opts.quiet)