Revert "Drop py2 support in gerrit and git related files"
This reverts commit b5c7f4b46c3309d46e1796bce7fa83388af9bfd8.
Reason for revert: missing a replace for urlparse.urlparse
Original change's description:
> Drop py2 support in gerrit and git related files
>
> python3 is the only supported version of python in depot_tools.
>
> Bug: 1475402
> Change-Id: Ie4ee18d297081b3aa0206b8d7ce6461819bff0ca
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4809560
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Commit-Queue: Gavin Mak <gavinmak@google.com>
Bug: 1475402
Change-Id: Idd00fdfe0b3d62785da2789a7dfcc9fbc79b6385
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4811623
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
diff --git a/git_common.py b/git_common.py
index 8ba938d..4add178 100644
--- a/git_common.py
+++ b/git_common.py
@@ -13,7 +13,9 @@
def wrapper(func):
def wrap(self, timeout=None):
- return func(self, timeout=timeout or threading.TIMEOUT_MAX)
+ 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)