Bug 1620511 - Make ensure_mobile_android_packages Python3 compatible. r=firefox-build-system-reviewers,rstewart

Differential Revision: https://phabricator.services.mozilla.com/D65683

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Makoto Kato 2020-03-06 17:30:27 +00:00
parent 72e401a747
commit 070a000dd4

View File

@ -74,15 +74,18 @@ class MozillaBuildBootstrapper(BaseBootstrapper):
def ensure_mobile_android_packages(self, artifact_mode=False):
# Get java path from registry key
import _winreg
try:
import _winreg
except ImportError:
import winreg as _winreg
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE,
r'SOFTWARE\JavaSoft\Java Development Kit\1.8')
java_path, regtype = _winreg.QueryValueEx(key, 'JavaHome')
_winreg.CloseKey(key)
os.environ['PATH'] = \
'{}{}{}'.format(os.path.join(java_path, 'bin'), os.pathsep,
os.environ['PATH']).encode('mbcs')
from mach.util import setenv
setenv('PATH', '{}{}{}'.format(os.path.join(java_path, 'bin'), os.pathsep,
os.environ['PATH']))
self.ensure_java()
from mozboot import android