Mercurial > public > mercurial-scm > hg
annotate mercurial/thirdparty/concurrent/futures/__init__.py @ 41758:15d3facfa40a
tests: use () instead of \ to wrap lines
This should auto-format more consistently, and is slightly more
typical Python.
Differential Revision: https://phab.mercurial-scm.org/D5992
author | Augie Fackler <augie@google.com> |
---|---|
date | Sun, 13 Jan 2019 20:13:22 -0500 |
parents | 0a9c0d3480b2 |
children |
rev | line source |
---|---|
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
1 # Copyright 2009 Brian Quinlan. All Rights Reserved. |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
2 # Licensed to PSF under a Contributor Agreement. |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
3 |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
4 """Execute computations asynchronously using threads or processes.""" |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
5 |
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
6 from __future__ import absolute_import |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
7 |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
8 __author__ = 'Brian Quinlan (brian@sweetapp.com)' |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
9 |
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
10 from ._base import ( |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
11 FIRST_COMPLETED, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
12 FIRST_EXCEPTION, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
13 ALL_COMPLETED, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
14 CancelledError, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
15 TimeoutError, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
16 Future, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
17 Executor, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
18 wait, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
19 as_completed, |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
20 ) |
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
21 from .thread import ThreadPoolExecutor |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
22 |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
23 try: |
37626
0a9c0d3480b2
futures: switch to absolute and relative imports
Gregory Szorc <gregory.szorc@gmail.com>
parents:
37623
diff
changeset
|
24 from .process import ProcessPoolExecutor |
37623
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
25 except ImportError: |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
26 # some platforms don't have multiprocessing |
eb687c28a915
thirdparty: vendor futures 3.2.0
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff
changeset
|
27 pass |