Commit de6c4564 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

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: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
parent 28be1ff8
......@@ -9,10 +9,17 @@ from __future__ import print_function
from __future__ import unicode_literals
import multiprocessing.pool
import sys
import threading
from multiprocessing.pool import IMapIterator
def wrapper(func):
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
IMapIterator.next = wrapper(IMapIterator.next)
IMapIterator.__next__ = IMapIterator.next
......@@ -29,10 +36,8 @@ import re
import setup_color
import shutil
import signal
import sys
import tempfile
import textwrap
import threading
import subprocess2
......
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