mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Fix max value for git_common threading
This fixes default value for Windows platform. Unit tests still don't work for Windows as CTRL+C handling is not working properly. Change-Id: I11fd33279313bfd7a2070e90164da6cf9f63696e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2121555 Commit-Queue: Josip Sokcevic <sokcevic@google.com> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
This commit is contained in:
@@ -9,10 +9,17 @@ from __future__ import print_function
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import multiprocessing.pool
|
import multiprocessing.pool
|
||||||
|
import sys
|
||||||
|
import threading
|
||||||
|
|
||||||
from multiprocessing.pool import IMapIterator
|
from multiprocessing.pool import IMapIterator
|
||||||
|
|
||||||
def wrapper(func):
|
def wrapper(func):
|
||||||
def wrap(self, timeout=None):
|
def wrap(self, timeout=None):
|
||||||
return func(self, timeout=timeout or 1 << 31)
|
default_timeout = (1 << 31 if sys.version_info.major == 2 else
|
||||||
|
threading.TIMEOUT_MAX)
|
||||||
|
return func(self, timeout=timeout or default_timeout)
|
||||||
|
|
||||||
return wrap
|
return wrap
|
||||||
IMapIterator.next = wrapper(IMapIterator.next)
|
IMapIterator.next = wrapper(IMapIterator.next)
|
||||||
IMapIterator.__next__ = IMapIterator.next
|
IMapIterator.__next__ = IMapIterator.next
|
||||||
@@ -29,10 +36,8 @@ import re
|
|||||||
import setup_color
|
import setup_color
|
||||||
import shutil
|
import shutil
|
||||||
import signal
|
import signal
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
import textwrap
|
import textwrap
|
||||||
import threading
|
|
||||||
|
|
||||||
import subprocess2
|
import subprocess2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user