Skip to content

Commit 0550200

Browse files
alexfiklinducer
authored andcommitted
fix(typing): add None to exc_type in __exit__
1 parent e61445d commit 0550200

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

pytools/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ def __enter__(self) -> None:
22852285
self.draw()
22862286

22872287
def __exit__(self,
2288-
exc_type: type[BaseException],
2288+
exc_type: type[BaseException] | None,
22892289
exc_val: BaseException | None,
22902290
exc_tb: types.TracebackType | None) -> None:
22912291
self.finished()
@@ -2515,7 +2515,7 @@ def __enter__(self) -> None:
25152515
sys.setrecursionlimit(new_limit)
25162516

25172517
def __exit__(self,
2518-
exc_type: type[BaseException],
2518+
exc_type: type[BaseException] | None,
25192519
exc_val: BaseException | None,
25202520
exc_tb: types.TracebackType | None) -> None:
25212521
# Deep recursion can produce deeply nested data structures
@@ -2678,7 +2678,7 @@ def __enter__(self) -> Self:
26782678
return self
26792679

26802680
def __exit__(self,
2681-
exc_type: type[BaseException],
2681+
exc_type: type[BaseException] | None,
26822682
exc_val: BaseException | None,
26832683
exc_tb: types.TracebackType | None) -> None:
26842684
self.done()
@@ -2841,7 +2841,7 @@ def __enter__(self):
28412841
pass
28422842

28432843
def __exit__(self,
2844-
exc_type: type[BaseException],
2844+
exc_type: type[BaseException] | None,
28452845
exc_val: BaseException | None,
28462846
exc_tb: types.TracebackType | None) -> None:
28472847
self.done()

pytools/codegen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __enter__(self) -> None:
115115
self.generator.indent()
116116

117117
def __exit__(self,
118-
exc_type: type[BaseException],
118+
exc_type: type[BaseException] | None,
119119
exc_val: BaseException | None,
120120
exc_tb: types.TracebackType | None) -> None:
121121
self.generator.dedent()

0 commit comments

Comments
 (0)