Skip to content

Commit a95da8c

Browse files
Fix mypy type narrowing error in cfg.py by adding None check before identity comparison
Agent-Logs-Url: https://github.com/MatthieuDartiailh/bytecode/sessions/b7904bd0-bbc8-412f-8f14-de2ed29696a1 Co-authored-by: MatthieuDartiailh <4481740+MatthieuDartiailh@users.noreply.github.com>
1 parent 2be6e1b commit a95da8c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/bytecode/cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ def run(self) -> Generator[Union["_StackSizeComputer", int], int, None]:
363363
# through a particular jump. So we are lenient here.
364364
if (
365365
te := self.block.get_trailing_try_end(i)
366-
) and te.entry is self._current_try_begin:
366+
) and self._current_try_begin is not None and te.entry is self._current_try_begin:
367367
assert isinstance(te.entry.target, BasicBlock)
368368
yield from self._compute_exception_handler_stack_usage(
369369
te.entry.target,

0 commit comments

Comments
 (0)