summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'coverage')
-rw-r--r--coverage/bytecode.py4
-rw-r--r--coverage/control.py4
-rw-r--r--coverage/debug.py5
-rw-r--r--coverage/misc.py4
-rw-r--r--coverage/sqldata.py6
5 files changed, 11 insertions, 12 deletions
diff --git a/coverage/bytecode.py b/coverage/bytecode.py
index e9a908f7..2cad4f9b 100644
--- a/coverage/bytecode.py
+++ b/coverage/bytecode.py
@@ -6,10 +6,10 @@
from __future__ import annotations
from types import CodeType
-from typing import Generator
+from typing import Iterator
-def code_objects(code: CodeType) -> Generator[CodeType, None, None]:
+def code_objects(code: CodeType) -> Iterator[CodeType]:
"""Iterate over all the code objects in `code`."""
stack = [code]
while stack:
diff --git a/coverage/control.py b/coverage/control.py
index 4e97ce9c..637a8f6a 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -20,7 +20,7 @@ import warnings
from types import FrameType
from typing import (
cast,
- Any, Callable, Dict, Generator, IO, Iterable, List, Optional, Tuple, Union,
+ Any, Callable, Dict, IO, Iterable, Iterator, List, Optional, Tuple, Union,
)
from coverage import env
@@ -56,7 +56,7 @@ from coverage.xmlreport import XmlReporter
os = isolate_module(os)
@contextlib.contextmanager
-def override_config(cov: Coverage, **kwargs: TConfigValueIn) -> Generator[None, None, None]:
+def override_config(cov: Coverage, **kwargs: TConfigValueIn) -> Iterator[None]:
"""Temporarily tweak the configuration of `cov`.
The arguments are applied to `cov.config` with the `from_args` method.
diff --git a/coverage/debug.py b/coverage/debug.py
index a3d1dfa8..145802b1 100644
--- a/coverage/debug.py
+++ b/coverage/debug.py
@@ -18,8 +18,7 @@ import types
import _thread
from typing import (
- Any, Callable, Generator, IO, Iterable, Iterator, Optional, List, Tuple,
- cast,
+ Any, Callable, IO, Iterable, Iterator, Optional, List, Tuple, cast,
)
from coverage.misc import isolate_module
@@ -65,7 +64,7 @@ class DebugControl:
return (option in self.options)
@contextlib.contextmanager
- def without_callers(self) -> Generator[None, None, None]:
+ def without_callers(self) -> Iterator[None]:
"""A context manager to prevent call stacks from being logged."""
old = self.suppress_callers
self.suppress_callers = True
diff --git a/coverage/misc.py b/coverage/misc.py
index 9b42d841..c2041b47 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -21,7 +21,7 @@ import types
from types import ModuleType
from typing import (
- Any, Callable, Dict, Generator, IO, Iterable, List, Mapping, Optional,
+ Any, Callable, Dict, IO, Iterable, Iterator, List, Mapping, Optional,
Sequence, Tuple, TypeVar, Union,
)
@@ -71,7 +71,7 @@ class SysModuleSaver:
@contextlib.contextmanager
-def sys_modules_saved() -> Generator[None, None, None]:
+def sys_modules_saved() -> Iterator[None]:
"""A context manager to remove any modules imported during a block."""
saver = SysModuleSaver()
try:
diff --git a/coverage/sqldata.py b/coverage/sqldata.py
index 4baea331..0a2f87a5 100644
--- a/coverage/sqldata.py
+++ b/coverage/sqldata.py
@@ -22,8 +22,8 @@ import threading
import zlib
from typing import (
- cast, Any, Callable, Collection, Dict, Generator, Iterable, List, Mapping, Optional,
- Sequence, Set, Tuple, TypeVar, Union,
+ cast, Any, Callable, Collection, Dict, Iterable, Iterator, List, Mapping,
+ Optional, Sequence, Set, Tuple, TypeVar, Union,
)
from coverage.debug import NoDebugging, AutoReprMixin, clipped_repr
@@ -1171,7 +1171,7 @@ class SqliteDb(AutoReprMixin):
self,
sql: str,
parameters: Iterable[Any]=(),
- ) -> Generator[sqlite3.Cursor, None, None]:
+ ) -> Iterator[sqlite3.Cursor]:
"""Context managed :meth:`python:sqlite3.Connection.execute`.
Use with a ``with`` statement to auto-close the returned cursor.