Skip to content

Commit 0049c52

Browse files
committed
lint
1 parent f4d483c commit 0049c52

File tree

6 files changed

+20
-7
lines changed

6 files changed

+20
-7
lines changed

mypyc/codegen/emitmodule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,9 @@ def __init__(
535535
"""
536536
self.modules = modules
537537
self.source_paths = source_paths
538-
self.context = EmitterContext(names, compiler_options.strict_traceback_checks, group_name, group_map)
538+
self.context = EmitterContext(
539+
names, compiler_options.strict_traceback_checks, group_name, group_map
540+
)
539541
self.names = names
540542
# Initializations of globals to simple values that we can't
541543
# do statically because the windows loader is bad.

mypyc/lower/misc_ops.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ def var_object_size(builder: LowLevelIRBuilder, args: list[Value], line: int) ->
1515
@lower_primitive_op("propagate_if_error")
1616
def propagate_if_error_op(builder: LowLevelIRBuilder, args: list[Value], line: int) -> Value:
1717
# Return False on NULL. The primitive uses ERR_FALSE, so this is an error.
18-
return builder.add(ComparisonOp(args[0], Integer(0, object_rprimitive), ComparisonOp.NEQ, line))
18+
return builder.add(
19+
ComparisonOp(args[0], Integer(0, object_rprimitive), ComparisonOp.NEQ, line)
20+
)

mypyc/test/test_misc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
class TestMisc(unittest.TestCase):
1212
def test_debug_op(self) -> None:
1313
block = BasicBlock()
14-
builder = LowLevelIRBuilder(errors=None, options=CompilerOptions(strict_traceback_checks=True))
14+
builder = LowLevelIRBuilder(
15+
errors=None, options=CompilerOptions(strict_traceback_checks=True)
16+
)
1517
builder.activate_block(block)
1618
builder.debug_print("foo")
1719

mypyc/test/testutil.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def infer_ir_build_options_from_test_name(name: str) -> CompilerOptions | None:
275275
return None
276276
if "_32bit" in name and not IS_32_BIT_PLATFORM:
277277
return None
278-
options = CompilerOptions(strip_asserts="StripAssert" in name, capi_version=(3, 9), strict_traceback_checks=True)
278+
options = CompilerOptions(
279+
strip_asserts="StripAssert" in name, capi_version=(3, 9), strict_traceback_checks=True
280+
)
279281
# A suffix like _python3_9 is used to set the target C API version.
280282
m = re.search(r"_python([3-9]+)_([0-9]+)(_|\b)", name)
281283
if m:

mypyc/transform/exceptions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def insert_exception_handling(ir: FuncIR, strict_traceback_checks: bool) -> None
4949
if error_label is None and any(op.can_raise() for op in block.ops):
5050
error_label = add_default_handler_block(ir)
5151
if error_label:
52-
ir.blocks = split_blocks_at_errors(ir.blocks, error_label, ir.traceback_name, strict_traceback_checks)
52+
ir.blocks = split_blocks_at_errors(
53+
ir.blocks, error_label, ir.traceback_name, strict_traceback_checks
54+
)
5355

5456

5557
def add_default_handler_block(ir: FuncIR) -> BasicBlock:
@@ -62,7 +64,10 @@ def add_default_handler_block(ir: FuncIR) -> BasicBlock:
6264

6365

6466
def split_blocks_at_errors(
65-
blocks: list[BasicBlock], default_error_handler: BasicBlock, func_name: str | None, strict_traceback_checks: bool,
67+
blocks: list[BasicBlock],
68+
default_error_handler: BasicBlock,
69+
func_name: str | None,
70+
strict_traceback_checks: bool,
6671
) -> list[BasicBlock]:
6772
new_blocks: list[BasicBlock] = []
6873

mypyc/transform/uninit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def insert_uninit_checks(ir: FuncIR, strict_traceback_checks: bool) -> None:
3737

3838

3939
def split_blocks_at_uninits(
40-
blocks: list[BasicBlock], pre_must_defined: AnalysisDict[Value], strict_traceback_checks: bool,
40+
blocks: list[BasicBlock], pre_must_defined: AnalysisDict[Value], strict_traceback_checks: bool
4141
) -> list[BasicBlock]:
4242
new_blocks: list[BasicBlock] = []
4343

0 commit comments

Comments
 (0)