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

Unified Diff: subprocess2.py

Issue 8361006: Fix subprocess2.Popen() logging when given a string (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 2 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: subprocess2.py
diff --git a/subprocess2.py b/subprocess2.py
index 034463fd20da0dfcad53ff2ccde1e61112cd98ad..4708aadf362ee347cf3d6528acc3c9007c917208 100644
--- a/subprocess2.py
+++ b/subprocess2.py
@@ -158,7 +158,12 @@ def Popen(args, **kwargs):
# with a list because it only tries to execute the first item in the list.
kwargs['shell'] = bool(sys.platform=='win32')
- tmp_str = ' '.join(args)
+ if isinstance(args, basestring):
+ tmp_str = args
+ elif isinstance(args, (list, tuple)):
+ tmp_str = ' '.join(args)
+ else:
+ raise CalledProcessError(None, args, kwargs.get('cwd'), None, None)
if kwargs.get('cwd', None):
tmp_str += '; cwd=%s' % kwargs['cwd']
logging.debug(tmp_str)
« 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