Backed out changeset 735394aa3813 (bug 1046087) for Windows bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2014-08-08 13:01:25 -04:00
parent 3262aee646
commit 1bcc49deea

View File

@ -3,7 +3,6 @@
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import re
import select
import signal
import subprocess
@ -839,17 +838,10 @@ falling back to not using job objects for managing child processes"""
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
GetLastError = ctypes.windll.kernel32.GetLastError
@staticmethod
def _normalize_newline(line):
# adb on windows returns \r\r\n at the end of each line, to get around
# this normalize all newlines to have a unix-style '\n'
# http://src.chromium.org/viewvc/chrome/trunk/src/build/android/pylib/android_commands.py#l1944
return re.sub(r'\r+\n?$', '\n', line)
def _readWithTimeout(self, f, timeout):
if timeout is None:
# shortcut to allow callers to pass in "None" for no timeout.
return (self._normalize(f.readline()), False)
return (f.readline(), False)
x = msvcrt.get_osfhandle(f.fileno())
l = ctypes.c_long()
done = time.time() + timeout
@ -863,7 +855,7 @@ falling back to not using job objects for managing child processes"""
if l.value > 0:
# we're assuming that the output is line-buffered,
# which is not unreasonable
return (self._normalize(f.readline()), False)
return (f.readline(), False)
time.sleep(0.01)
return ('', True)