mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2025-12-31 21:06:25 +00:00
add return None statements
This commit is contained in:
@ -106,19 +106,19 @@ def vmlinux_proc(tree: ast.AST, module):
|
|||||||
|
|
||||||
if not import_statements:
|
if not import_statements:
|
||||||
logger.info("No vmlinux imports found")
|
logger.info("No vmlinux imports found")
|
||||||
return
|
return None
|
||||||
|
|
||||||
# Import vmlinux module directly
|
# Import vmlinux module directly
|
||||||
try:
|
try:
|
||||||
vmlinux_mod = importlib.import_module("vmlinux")
|
vmlinux_mod = importlib.import_module("vmlinux")
|
||||||
except ImportError:
|
except ImportError:
|
||||||
logger.warning("Could not import vmlinux module")
|
logger.warning("Could not import vmlinux module")
|
||||||
return
|
return None
|
||||||
|
|
||||||
source_file = inspect.getsourcefile(vmlinux_mod)
|
source_file = inspect.getsourcefile(vmlinux_mod)
|
||||||
if source_file is None:
|
if source_file is None:
|
||||||
logger.warning("Cannot find source for vmlinux module")
|
logger.warning("Cannot find source for vmlinux module")
|
||||||
return
|
return None
|
||||||
|
|
||||||
with open(source_file, "r") as f:
|
with open(source_file, "r") as f:
|
||||||
mod_ast = ast.parse(f.read(), filename=source_file)
|
mod_ast = ast.parse(f.read(), filename=source_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user