Skip to content

Commit

Permalink
Bug 899695 - Fix exception in "mach python" on Windows [r=gps]
Browse files Browse the repository at this point in the history
DONTBUILD (not part of the build)
  • Loading branch information
mbrubeck committed Aug 8, 2013
1 parent 4eb4d06 commit 88e1010
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions mach
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ for dir_path in ancestors(os.getcwd()):
# to look for a config file at the path in $MOZCONFIG rather than
# its default locations.
#
# Note: subprocess requires native strings in os.environ Python
# 2.7.2 and earlier on Windows.
# Note: subprocess requires native strings in os.environ on Windows
os.environ[b"MOZCONFIG"] = str(info["mozconfig"])

if "topsrcdir" in info:
Expand Down
6 changes: 4 additions & 2 deletions python/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def python(self, args):
return self.run_process([self.python_executable] + args,
pass_thru=True, # Allow user to run Python interactively.
ensure_exit_code=False, # Don't throw on non-zero exit code.
append_env={'PYTHONDONTWRITEBYTECODE': '1'})
# Note: subprocess requires native strings in os.environ on Windows
append_env={b'PYTHONDONTWRITEBYTECODE': str('1')})

@Command('python-test', category='testing',
description='Run Python unit tests.')
Expand Down Expand Up @@ -109,7 +110,8 @@ def _line_handler(line):
[self.python_executable, file],
ensure_exit_code=False, # Don't throw on non-zero exit code.
log_name='python-test',
append_env={'PYTHONDONTWRITEBYTECODE': '1'},
# subprocess requires native strings in os.environ on Windows
append_env={b'PYTHONDONTWRITEBYTECODE': str('1')},
line_handler=_line_handler)
return_code += inner_return_code

Expand Down
1 change: 0 additions & 1 deletion testing/mochitest/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ def run_mochitest_test(self, suite=None, test_file=None, debugger=None,
return 1

options.testPath = test_path
env = {'TEST_PATH': test_path}

if rerun_failures:
options.testManifest = failure_file_path
Expand Down

0 comments on commit 88e1010

Please sign in to comment.