Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: abp_rewrite.py

Issue 29350236: Issue 4373 - Made jshydra compatible with Python 3 (Closed)
Left Patch Set: Created Aug. 28, 2016, 10:11 p.m.
Right Patch Set: Use urllib2, removed redundant future import, added option to test without caching Created Aug. 30, 2016, 11:33 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « .hgignore ('k') | autotest.py » ('j') | utils.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # This Source Code is subject to the terms of the Mozilla Public License 1 # This Source Code is subject to the terms of the Mozilla Public License
2 # version 2.0 (the "License"). You can obtain a copy of the License at 2 # version 2.0 (the "License"). You can obtain a copy of the License at
3 # http://mozilla.org/MPL/2.0/. 3 # http://mozilla.org/MPL/2.0/.
4
5 from __future__ import print_function
Sebastian Noack 2016/08/30 11:44:38 I just noticed that this future import here isn't
Vasily Kuznetsov 2016/08/30 13:16:30 Acknowledged.
6 4
7 import os 5 import os
8 import subprocess 6 import subprocess
9 7
10 import utils 8 import utils
11 9
12 10
13 def rewrite_js(args, script=None): 11 def rewrite_js(args, script=None):
Sebastian Noack 2016/08/28 22:36:13 Yes, this is a breaking change that needs to be ad
Vasily Kuznetsov 2016/08/30 13:16:30 Acknowledged.
14 jsshell = utils.ensureJSShell() 12 jsshell = utils.ensureJSShell()
15 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))} 13 env = {'LD_LIBRARY_PATH': os.path.relpath(os.path.dirname(jsshell))}
16 base_dir = os.path.dirname(__file__) 14 base_dir = os.path.dirname(__file__)
17 15
18 if not script: 16 if not script:
19 script = os.path.join(base_dir, 'scripts', 'abprewrite.js') 17 script = os.path.join(base_dir, 'scripts', 'abprewrite.js')
20 18
21 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args 19 command = [jsshell, os.path.join(base_dir, 'jshydra.js'), script] + args
22 return subprocess.check_output(command, env=env, universal_newlines=True) 20 return subprocess.check_output(command, env=env, universal_newlines=True)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld