Show More
@@ -10,18 +10,12 b' import errno' | |||
|
10 | 10 | import gc |
|
11 | 11 | import os |
|
12 | 12 | import random |
|
13 | import selectors | |
|
13 | 14 | import signal |
|
14 | 15 | import socket |
|
15 | 16 | import struct |
|
16 | 17 | import traceback |
|
17 | 18 | |
|
18 | try: | |
|
19 | import selectors | |
|
20 | ||
|
21 | selectors.BaseSelector | |
|
22 | except ImportError: | |
|
23 | from .thirdparty import selectors2 as selectors | |
|
24 | ||
|
25 | 19 | from .i18n import _ |
|
26 | 20 | from .pycompat import getattr |
|
27 | 21 | from . import ( |
@@ -644,15 +638,7 b' class unixforkingservice:' | |||
|
644 | 638 | # waiting for recv() will receive ECONNRESET. |
|
645 | 639 | self._unlinksocket() |
|
646 | 640 | exiting = True |
|
647 | try: | |
|
648 | events = selector.select(timeout=h.pollinterval) | |
|
649 | except OSError as inst: | |
|
650 | # selectors2 raises ETIMEDOUT if timeout exceeded while | |
|
651 | # handling signal interrupt. That's probably wrong, but | |
|
652 | # we can easily get around it. | |
|
653 | if inst.errno != errno.ETIMEDOUT: | |
|
654 | raise | |
|
655 | events = [] | |
|
641 | events = selector.select(timeout=h.pollinterval) | |
|
656 | 642 | if not events: |
|
657 | 643 | # only exit if we completed all queued requests |
|
658 | 644 | if exiting: |
@@ -9,18 +9,12 b'' | |||
|
9 | 9 | import errno |
|
10 | 10 | import os |
|
11 | 11 | import pickle |
|
12 | import selectors | |
|
12 | 13 | import signal |
|
13 | 14 | import sys |
|
14 | 15 | import threading |
|
15 | 16 | import time |
|
16 | 17 | |
|
17 | try: | |
|
18 | import selectors | |
|
19 | ||
|
20 | selectors.BaseSelector | |
|
21 | except ImportError: | |
|
22 | from .thirdparty import selectors2 as selectors | |
|
23 | ||
|
24 | 18 | from .i18n import _ |
|
25 | 19 | from . import ( |
|
26 | 20 | encoding, |
@@ -304,7 +298,9 b' def _posixworker(ui, func, staticargs, a' | |||
|
304 | 298 | yield res |
|
305 | 299 | except EOFError: |
|
306 | 300 | selector.unregister(key.fileobj) |
|
301 | # pytype: disable=attribute-error | |
|
307 | 302 | key.fileobj.close() |
|
303 | # pytype: enable=attribute-error | |
|
308 | 304 | openpipes -= 1 |
|
309 | 305 | except IOError as e: |
|
310 | 306 | if e.errno == errno.EINTR: |
General Comments 0
You need to be logged in to leave comments.
Login now