##// END OF EJS Templates
futures: switch to absolute and relative imports...
Gregory Szorc -
r37644:0a9c0d34 default
parent child Browse files
Show More
@@ -3,21 +3,25 b''
3
3
4 """Execute computations asynchronously using threads or processes."""
4 """Execute computations asynchronously using threads or processes."""
5
5
6 from __future__ import absolute_import
7
6 __author__ = 'Brian Quinlan (brian@sweetapp.com)'
8 __author__ = 'Brian Quinlan (brian@sweetapp.com)'
7
9
8 from concurrent.futures._base import (FIRST_COMPLETED,
10 from ._base import (
9 FIRST_EXCEPTION,
11 FIRST_COMPLETED,
10 ALL_COMPLETED,
12 FIRST_EXCEPTION,
11 CancelledError,
13 ALL_COMPLETED,
12 TimeoutError,
14 CancelledError,
13 Future,
15 TimeoutError,
14 Executor,
16 Future,
15 wait,
17 Executor,
16 as_completed)
18 wait,
17 from concurrent.futures.thread import ThreadPoolExecutor
19 as_completed,
20 )
21 from .thread import ThreadPoolExecutor
18
22
19 try:
23 try:
20 from concurrent.futures.process import ProcessPoolExecutor
24 from .process import ProcessPoolExecutor
21 except ImportError:
25 except ImportError:
22 # some platforms don't have multiprocessing
26 # some platforms don't have multiprocessing
23 pass
27 pass
@@ -1,6 +1,8 b''
1 # Copyright 2009 Brian Quinlan. All Rights Reserved.
1 # Copyright 2009 Brian Quinlan. All Rights Reserved.
2 # Licensed to PSF under a Contributor Agreement.
2 # Licensed to PSF under a Contributor Agreement.
3
3
4 from __future__ import absolute_import
5
4 import collections
6 import collections
5 import logging
7 import logging
6 import threading
8 import threading
@@ -43,8 +43,10 b' Process #1..n:'
43 _ResultItems in "Request Q"
43 _ResultItems in "Request Q"
44 """
44 """
45
45
46 from __future__ import absolute_import
47
46 import atexit
48 import atexit
47 from concurrent.futures import _base
49 from . import _base
48 import Queue as queue
50 import Queue as queue
49 import multiprocessing
51 import multiprocessing
50 import threading
52 import threading
@@ -3,8 +3,10 b''
3
3
4 """Implements ThreadPoolExecutor."""
4 """Implements ThreadPoolExecutor."""
5
5
6 from __future__ import absolute_import
7
6 import atexit
8 import atexit
7 from concurrent.futures import _base
9 from . import _base
8 import itertools
10 import itertools
9 import Queue as queue
11 import Queue as queue
10 import threading
12 import threading
General Comments 0
You need to be logged in to leave comments. Login now