From 4d0dd68d5646adf396876963f865fe97c6a16894 Mon Sep 17 00:00:00 2001 From: varun-r-mallya Date: Thu, 2 Oct 2025 17:58:24 +0530 Subject: [PATCH] fix formatting --- pythonbpf/binary_ops.py | 1 + pythonbpf/codegen.py | 7 ++++--- pythonbpf/expr_pass.py | 1 + pythonbpf/functions_pass.py | 4 +++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pythonbpf/binary_ops.py b/pythonbpf/binary_ops.py index 16f94f6..e0b69f3 100644 --- a/pythonbpf/binary_ops.py +++ b/pythonbpf/binary_ops.py @@ -5,6 +5,7 @@ import logging logger: Logger = logging.getLogger(__name__) + def recursive_dereferencer(var, builder): """dereference until primitive type comes out""" if var.type == ir.PointerType(ir.PointerType(ir.IntType(64))): diff --git a/pythonbpf/codegen.py b/pythonbpf/codegen.py index cc9e7bf..a5824eb 100644 --- a/pythonbpf/codegen.py +++ b/pythonbpf/codegen.py @@ -50,8 +50,7 @@ def processor(source_code, filename, module): def compile_to_ir(filename: str, output: str, loglevel=logging.WARNING): logging.basicConfig( - level=loglevel, - format="%(asctime)s [%(levelname)s] %(name)s: %(message)s" + level=loglevel, format="%(asctime)s [%(levelname)s] %(name)s: %(message)s" ) with open(filename) as f: source = f.read() @@ -147,7 +146,9 @@ def compile(loglevel=logging.WARNING) -> bool: o_file = caller_file.with_suffix(".o") success = True - success = compile_to_ir(str(caller_file), str(ll_file), loglevel=loglevel) and success + success = ( + compile_to_ir(str(caller_file), str(ll_file), loglevel=loglevel) and success + ) success = bool( subprocess.run( diff --git a/pythonbpf/expr_pass.py b/pythonbpf/expr_pass.py index 4c77722..1befbb4 100644 --- a/pythonbpf/expr_pass.py +++ b/pythonbpf/expr_pass.py @@ -5,6 +5,7 @@ import logging logger: Logger = logging.getLogger(__name__) + def eval_expr( func, module, diff --git a/pythonbpf/functions_pass.py b/pythonbpf/functions_pass.py index 9d9bd8b..37728e1 100644 --- a/pythonbpf/functions_pass.py +++ b/pythonbpf/functions_pass.py @@ -449,7 +449,9 @@ def allocate_mem( ir_type = ctypes_to_ir(call_type) var = builder.alloca(ir_type, name=var_name) var.align = ir_type.width // 8 - logger.info(f"Pre-allocated variable {var_name} of type {call_type}") + logger.info( + f"Pre-allocated variable {var_name} of type {call_type}" + ) elif HelperHandlerRegistry.has_handler(call_type): # Assume return type is int64 for now ir_type = ir.IntType(64)