Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(988)

Unified Diff: third_party/WebKit/Source/devtools/scripts/compile_frontend.py

Issue 2554573010: DevTools: fix presubmit hooks for windows (Closed)
Patch Set: include utils.py in BUILD.gn isolate target Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/scripts/compile_frontend.py
diff --git a/third_party/WebKit/Source/devtools/scripts/compile_frontend.py b/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
index afc56679eec363850e892b14eb82d0959119b04a..911570de6a138541443c588f1830dc94f8edcfa9 100755
--- a/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
+++ b/third_party/WebKit/Source/devtools/scripts/compile_frontend.py
@@ -38,6 +38,8 @@ import tempfile
from build import modular_build
from build import generate_protocol_externs
+import utils
+
try:
import simplejson as json
except ImportError:
@@ -97,24 +99,6 @@ errors_found = False
generate_protocol_externs.generate_protocol_externs(protocol_externs_file, path.join(inspector_path, 'browser_protocol.json'), path.join(v8_inspector_path, 'js_protocol.json'))
-# Based on http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python.
-def which(program):
- def is_exe(fpath):
- return path.isfile(fpath) and os.access(fpath, os.X_OK)
-
- fpath, fname = path.split(program)
- if fpath:
- if is_exe(program):
- return program
- else:
- for part in os.environ["PATH"].split(os.pathsep):
- part = part.strip('"')
- exe_file = path.join(part, program)
- if is_exe(exe_file):
- return exe_file
- return None
-
-
def log_error(message):
print 'ERROR: ' + message
@@ -207,9 +191,7 @@ def find_java():
required_minor = 7
exec_command = None
has_server_jvm = True
- java_path = which('java')
- if not java_path:
- java_path = which('java.exe')
+ java_path = utils.which('java')
if not java_path:
print 'NOTE: No Java executable found in $PATH.'
« no previous file with comments | « third_party/WebKit/Source/devtools/BUILD.gn ('k') | third_party/WebKit/Source/devtools/scripts/install_node_deps.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698