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

Unified Diff: subprocess2.py

Issue 6689023: Revert r80216 "Reapply r79779: "Removed gclient_utils.Popen() and use subprocess2's ..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 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 | « gclient_utils.py ('k') | tests/gclient_utils_test.py » ('j') | 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 d4fa5781d6ee1be9f99b14ab17c156f2b02f1260..c9057ac6ae19dd32c996b6c333bd5cc071a21d84 100644
--- a/subprocess2.py
+++ b/subprocess2.py
@@ -8,7 +8,6 @@ In theory you shouldn't need anything else in subprocess, or this module failed.
"""
from __future__ import with_statement
-import errno
import logging
import os
import subprocess
@@ -125,7 +124,7 @@ def get_english_env(env):
def Popen(args, **kwargs):
- """Wraps subprocess.Popen() with various workarounds.
+ """Wraps subprocess.Popen().
Returns a subprocess.Popen object.
@@ -135,8 +134,7 @@ def Popen(args, **kwargs):
shell parameter to a value.
- Adds support for VOID to not buffer when not needed.
- Note: Popen() can throw OSError when cwd or args[0] doesn't exist. Translate
- exceptions generated by cygwin when it fails trying to emulate fork().
+ Note: Popen() can throw OSError when cwd or args[0] doesn't exist.
"""
# Make sure we hack subprocess if necessary.
hack_subprocess()
@@ -162,20 +160,7 @@ def Popen(args, **kwargs):
kwargs['stdout'] = open(os.devnull, 'w')
if kwargs.get('stderr') in (VOID, os.devnull):
kwargs['stderr'] = open(os.devnull, 'w')
- try:
- return subprocess.Popen(args, **kwargs)
- except OSError, e:
- if e.errno == errno.EAGAIN and sys.platform == 'cygwin':
- # Convert fork() emulation failure into a CalledProcessError().
- raise CalledProcessError(
- e.errno,
- args,
- kwargs.get('cwd'),
- 'Visit '
- 'http://code.google.com/p/chromium/wiki/CygwinDllRemappingFailure to '
- 'learn how to fix this error; you need to rebase your cygwin dlls',
- None)
- raise
+ return subprocess.Popen(args, **kwargs)
def call(args, timeout=None, **kwargs):
« no previous file with comments | « gclient_utils.py ('k') | tests/gclient_utils_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698