Commit 926e22dc authored by Denis Bilenko's avatar Denis Bilenko

pep8

parent a4df5df6
......@@ -153,7 +153,7 @@ class Condition(object):
# little at first, longer as time goes on, but never longer
# than 20 times per second (or the timeout time remaining).
endtime = _time() + timeout
delay = 0.0005 # 500 us -> initial delay of 1 ms
delay = 0.0005 # 500 us -> initial delay of 1 ms
while True:
gotit = waiter.acquire(0)
if gotit:
......
......@@ -33,7 +33,6 @@ else:
from types import UnboundMethodType
class NA(object):
def __repr__(self):
......@@ -41,7 +40,6 @@ else:
NA = NA()
class SocketAdapter(object):
"""Socket-like API on top of a file descriptor.
......@@ -159,7 +157,6 @@ else:
if SocketAdapter__del__:
SocketAdapter.__del__ = UnboundMethodType(SocketAdapter__del__, None, SocketAdapter)
class FileObjectPosix(_fileobject):
def __init__(self, fobj, mode='rb', bufsize=-1, close=True):
......
......@@ -7,6 +7,7 @@ try:
from gevent._util import set_exc_info
except ImportError, ex:
sys.stderr.write('Failed to import set_exc_info: %s\n' % ex)
def set_exc_info(*args):
pass
......
......@@ -204,11 +204,9 @@ class Popen(object):
return (None if stdout is None else stdout.value or '',
None if stderr is None else stderr.value or '')
def poll(self):
return self._internal_poll()
if mswindows:
#
# Windows methods
......@@ -269,14 +267,12 @@ class Popen(object):
c2pread, c2pwrite,
errread, errwrite)
def _make_inheritable(self, handle):
"""Return a duplicate of handle, which is inheritable"""
return _subprocess.DuplicateHandle(_subprocess.GetCurrentProcess(),
handle, _subprocess.GetCurrentProcess(), 0, 1,
_subprocess.DUPLICATE_SAME_ACCESS)
def _find_w9xpopen(self):
"""Find and return absolut path to w9xpopen.exe"""
w9xpopen = os.path.join(
......@@ -293,7 +289,6 @@ class Popen(object):
"shell or platform.")
return w9xpopen
def _execute_child(self, args, executable, preexec_fn, close_fds,
cwd, env, universal_newlines,
startupinfo, creationflags, shell,
......@@ -318,7 +313,7 @@ class Popen(object):
startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW
startupinfo.wShowWindow = _subprocess.SW_HIDE
comspec = os.environ.get("COMSPEC", "cmd.exe")
args = '{} /c "{}"'.format (comspec, args)
args = '{} /c "{}"'.format(comspec, args)
if (_subprocess.GetVersion() >= 0x80000000 or
os.path.basename(comspec).lower() == "command.com"):
# Win9x, or using command.com on NT. We need to
......@@ -379,7 +374,6 @@ class Popen(object):
self.returncode = _subprocess.GetExitCodeProcess(self._handle)
return self.returncode
def wait(self):
"""Wait for child process to terminate. Returns returncode
attribute."""
......@@ -455,7 +449,6 @@ class Popen(object):
c2pread, c2pwrite,
errread, errwrite)
def _set_cloexec_flag(self, fd, cloexec=True):
try:
cloexec_flag = fcntl.FD_CLOEXEC
......@@ -468,7 +461,6 @@ class Popen(object):
else:
fcntl.fcntl(fd, fcntl.F_SETFD, old & ~cloexec_flag)
def _close_fds(self, but):
if hasattr(os, 'closerange'):
os.closerange(3, but)
......@@ -482,7 +474,6 @@ class Popen(object):
except:
pass
def _execute_child(self, args, executable, preexec_fn, close_fds,
cwd, env, universal_newlines,
startupinfo, creationflags, shell,
......@@ -618,7 +609,6 @@ class Popen(object):
os.close(fd)
raise child_exception
def _handle_exitstatus(self, sts):
if os.WIFSIGNALED(sts):
self.returncode = -os.WTERMSIG(sts)
......@@ -628,14 +618,12 @@ class Popen(object):
# Should never happen
raise RuntimeError("Unknown child exit status!")
def _internal_poll(self):
"""Check if child process has terminated. Returns returncode
attribute.
"""
return self.returncode
def wait(self):
"""Wait for child process to terminate. Returns returncode
attribute."""
......@@ -643,7 +631,6 @@ class Popen(object):
self._event.wait()
return self.returncode
def send_signal(self, sig):
"""Send a signal to the process
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment