MCPcopy Index your code
hub / github.com/python/mypy / inside_except_star_block_set

Method inside_except_star_block_set

mypy/semanal.py:577–593  ·  view source on GitHub ↗
(
        self, value: bool, entering_loop: bool = False
    )

Source from the content-addressed store, hash-verified

575
576 @contextmanager
577 def inside_except_star_block_set(
578 self, value: bool, entering_loop: bool = False
579 ) -> Iterator[None]:
580 old = self.inside_except_star_block
581 self.inside_except_star_block = value
582
583 # Return statement would still be in except* scope if entering loops
584 if not entering_loop:
585 old_return_stmt_flag = self.return_stmt_inside_except_star_block
586 self.return_stmt_inside_except_star_block = value
587
588 try:
589 yield
590 finally:
591 self.inside_except_star_block = old
592 if not entering_loop:
593 self.return_stmt_inside_except_star_block = old_return_stmt_flag
594
595 #
596 # Preparing module (performed before semantic analysis)

Callers 5

visit_func_defMethod · 0.95
visit_while_stmtMethod · 0.95
visit_for_stmtMethod · 0.95
analyze_try_stmtMethod · 0.95
visit_lambda_exprMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected