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

Unified Diff: testing/xvfb.py

Issue 2748123004: xvfb.py complains if command points to a directory. (Closed)
Patch Set: Created 3 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/xvfb.py
diff --git a/testing/xvfb.py b/testing/xvfb.py
index a5620e7cde4072d7bd8b5f6bef54b27af767d9e1..af311e93fc6d6b753894841ad7893717cd825d62 100755
--- a/testing/xvfb.py
+++ b/testing/xvfb.py
@@ -6,6 +6,7 @@
"""Runs tests with Xvfb and Openbox on Linux and normally on other platforms."""
import os
+import os.path
import platform
import signal
import subprocess
@@ -80,10 +81,15 @@ def run_executable(cmd, env):
def main():
+ USAGE = 'Usage: xvfb.py [command args...]'
if len(sys.argv) < 2:
- print >> sys.stderr, (
- 'Usage: xvfb.py [command args...]')
+ print >> sys.stderr, USAGE
return 2
+ if os.path.isdir(sys.argv[1]):
Tom Anderson 2017/03/14 22:43:43 nit: add a comment explaining why we have this cas
carlosk 2017/03/14 23:47:23 Done.
+ print >> sys.stderr, (
+ 'Invalid command: it\'s a directory')
+ print >> sys.stderr, USAGE
+ return 3
return run_executable(sys.argv[1:], os.environ.copy())
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698