diff --git a/pytools/__init__.py b/pytools/__init__.py index 28c25917..1e3c05ef 100644 --- a/pytools/__init__.py +++ b/pytools/__init__.py @@ -2285,7 +2285,7 @@ def __enter__(self) -> None: self.draw() def __exit__(self, - exc_type: type[BaseException], + exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: self.finished() @@ -2515,7 +2515,7 @@ def __enter__(self) -> None: sys.setrecursionlimit(new_limit) def __exit__(self, - exc_type: type[BaseException], + exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: # Deep recursion can produce deeply nested data structures @@ -2678,7 +2678,7 @@ def __enter__(self) -> Self: return self def __exit__(self, - exc_type: type[BaseException], + exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: self.done() @@ -2841,7 +2841,7 @@ def __enter__(self): pass def __exit__(self, - exc_type: type[BaseException], + exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: self.done() diff --git a/pytools/codegen.py b/pytools/codegen.py index 622b4c36..7d962ace 100644 --- a/pytools/codegen.py +++ b/pytools/codegen.py @@ -115,7 +115,7 @@ def __enter__(self) -> None: self.generator.indent() def __exit__(self, - exc_type: type[BaseException], + exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: types.TracebackType | None) -> None: self.generator.dedent()