diff --git a/stdlib/3/asyncio/futures.pyi b/stdlib/3/asyncio/futures.pyi index 1e492e1b5..768bfee01 100644 --- a/stdlib/3/asyncio/futures.pyi +++ b/stdlib/3/asyncio/futures.pyi @@ -1,7 +1,7 @@ import sys from typing import Any, Union, Callable, TypeVar, Type, List, Iterable, Generator, Awaitable, Optional, Tuple from .events import AbstractEventLoop -from concurrent.futures import ( +from concurrent.futures._base import ( Future as _ConcurrentFuture, Error, ) diff --git a/stdlib/3/concurrent/futures/__init__.pyi b/stdlib/3/concurrent/futures/__init__.pyi index 4439dcadb..66bc60f81 100644 --- a/stdlib/3/concurrent/futures/__init__.pyi +++ b/stdlib/3/concurrent/futures/__init__.pyi @@ -1,3 +1,18 @@ -from ._base import * # noqa: F403 -from .thread import * # noqa: F403 -from .process import * # noqa: F403 +import sys +from ._base import ( + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + ALL_COMPLETED as ALL_COMPLETED, + CancelledError as CancelledError, + TimeoutError as TimeoutError, + Future as Future, + Executor as Executor, + wait as wait, + as_completed as as_completed, +) +if sys.version_info >= (3, 8): + from ._base import InvalidStateError as InvalidStateError +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor as BrokenExecutor +from .thread import ThreadPoolExecutor +from .process import ProcessPoolExecutor diff --git a/stdlib/3/concurrent/futures/_base.pyi b/stdlib/3/concurrent/futures/_base.pyi index 00ff41d76..27caf7c3c 100644 --- a/stdlib/3/concurrent/futures/_base.pyi +++ b/stdlib/3/concurrent/futures/_base.pyi @@ -17,6 +17,8 @@ LOGGER: Logger class Error(Exception): ... class CancelledError(Error): ... class TimeoutError(Error): ... +if sys.version_info >= (3, 8): + class InvalidStateError(Error): ... if sys.version_info >= (3, 7): class BrokenExecutor(RuntimeError): ... diff --git a/tests/stubtest_whitelists/py37.txt b/tests/stubtest_whitelists/py37.txt index d37f7d282..c45840648 100644 --- a/tests/stubtest_whitelists/py37.txt +++ b/tests/stubtest_whitelists/py37.txt @@ -24,7 +24,7 @@ collections.abc.AsyncGenerator.ag_await collections.abc.AsyncGenerator.ag_code collections.abc.AsyncGenerator.ag_frame collections.abc.AsyncGenerator.ag_running -concurrent.futures.BrokenThreadPool +concurrent.futures.ProcessPoolExecutor.map contextvars.Context.__init__ contextvars.Context.get copy.PyStringMap diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index e31f5724e..eb6912e2e 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -47,8 +47,8 @@ collections.abc.Container.__contains__ collections.abc.ItemsView.__reversed__ collections.abc.KeysView.__reversed__ collections.abc.ValuesView.__reversed__ -concurrent.futures.BrokenThreadPool concurrent.futures.Executor.submit +concurrent.futures.ProcessPoolExecutor.map concurrent.futures.ProcessPoolExecutor.submit concurrent.futures.ThreadPoolExecutor.submit concurrent.futures._base.Executor.submit diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 53f9b0539..d58ac3cfc 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -123,17 +123,7 @@ collections.abc.Sequence.count collections.abc.Sequence.index collections.abc.Set.isdisjoint collections.deque.__hash__ -concurrent.futures.BrokenProcessPool -concurrent.futures.CANCELLED -concurrent.futures.CANCELLED_AND_NOTIFIED -concurrent.futures.EXTRA_QUEUED_CALLS -concurrent.futures.Error concurrent.futures.Executor.map -concurrent.futures.FINISHED -concurrent.futures.LOGGER -concurrent.futures.PENDING -concurrent.futures.ProcessPoolExecutor.map -concurrent.futures.RUNNING concurrent.futures._base.Executor.map concurrent.futures.process.ProcessPoolExecutor.map configparser.LegacyInterpolation.before_get diff --git a/third_party/2/concurrent/futures/__init__.pyi b/third_party/2/concurrent/futures/__init__.pyi index 4439dcadb..66bc60f81 100644 --- a/third_party/2/concurrent/futures/__init__.pyi +++ b/third_party/2/concurrent/futures/__init__.pyi @@ -1,3 +1,18 @@ -from ._base import * # noqa: F403 -from .thread import * # noqa: F403 -from .process import * # noqa: F403 +import sys +from ._base import ( + FIRST_COMPLETED as FIRST_COMPLETED, + FIRST_EXCEPTION as FIRST_EXCEPTION, + ALL_COMPLETED as ALL_COMPLETED, + CancelledError as CancelledError, + TimeoutError as TimeoutError, + Future as Future, + Executor as Executor, + wait as wait, + as_completed as as_completed, +) +if sys.version_info >= (3, 8): + from ._base import InvalidStateError as InvalidStateError +if sys.version_info >= (3, 7): + from ._base import BrokenExecutor as BrokenExecutor +from .thread import ThreadPoolExecutor +from .process import ProcessPoolExecutor diff --git a/third_party/2/concurrent/futures/_base.pyi b/third_party/2/concurrent/futures/_base.pyi index 00ff41d76..27caf7c3c 100644 --- a/third_party/2/concurrent/futures/_base.pyi +++ b/third_party/2/concurrent/futures/_base.pyi @@ -17,6 +17,8 @@ LOGGER: Logger class Error(Exception): ... class CancelledError(Error): ... class TimeoutError(Error): ... +if sys.version_info >= (3, 8): + class InvalidStateError(Error): ... if sys.version_info >= (3, 7): class BrokenExecutor(RuntimeError): ...