mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
Issue #2512 - Part 5 - Fix Python 2.7 issue with unicode environment on Windows.
This commit is contained in:
parent
7b01d356f9
commit
96c2d6bc43
1 changed files with 8 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ m4 = check_prog(
|
||||||
@imports(_from='__builtin__', _import='open')
|
@imports(_from='__builtin__', _import='open')
|
||||||
@imports(_from='__builtin__', _import='print')
|
@imports(_from='__builtin__', _import='print')
|
||||||
@imports('glob')
|
@imports('glob')
|
||||||
|
@imports('sys')
|
||||||
@imports('itertools')
|
@imports('itertools')
|
||||||
@imports('subprocess')
|
@imports('subprocess')
|
||||||
# Import getmtime without overwriting the sandbox os.path.
|
# Import getmtime without overwriting the sandbox os.path.
|
||||||
|
|
@ -65,10 +66,16 @@ def prepare_configure(old_configure, mozconfig, awk, m4, build_env, shell,
|
||||||
env['M4'] = m4
|
env['M4'] = m4
|
||||||
env['AWK'] = awk
|
env['AWK'] = awk
|
||||||
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
|
env['AC_MACRODIR'] = os.path.join(build_env.topsrcdir, 'build', 'autoconf')
|
||||||
|
my_env = env
|
||||||
|
# Handle Python 2.7 not allowing unicode in the environment on Windows
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
my_env = dict()
|
||||||
|
for e in env:
|
||||||
|
my_env[e.encode('ascii','ignore')] = env[e].encode('ascii','ignore')
|
||||||
script = subprocess.check_output([
|
script = subprocess.check_output([
|
||||||
shell, autoconf,
|
shell, autoconf,
|
||||||
'--localdir=%s' % os.path.dirname(old_configure),
|
'--localdir=%s' % os.path.dirname(old_configure),
|
||||||
old_configure + '.in'], env=env)
|
old_configure + '.in'], env=my_env)
|
||||||
|
|
||||||
# Make old-configure append to config.log, where we put our own log.
|
# Make old-configure append to config.log, where we put our own log.
|
||||||
# This could be done with a m4 macro, but it's way easier this way
|
# This could be done with a m4 macro, but it's way easier this way
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue