From c447efa482c663a77535bc76e222e980a730bcb9 Mon Sep 17 00:00:00 2001 From: caandt Date: Fri, 11 Jul 2025 11:52:54 -0500 Subject: [PATCH] nit --- pylingual/control_flow_reconstruction/structure.py | 3 ++- pylingual/main.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pylingual/control_flow_reconstruction/structure.py b/pylingual/control_flow_reconstruction/structure.py index 819fe02..b7d1ea8 100644 --- a/pylingual/control_flow_reconstruction/structure.py +++ b/pylingual/control_flow_reconstruction/structure.py @@ -32,7 +32,8 @@ def structure_control_flow(cfg: nx.DiGraph, bytecode: EditableBytecode) -> Contr if not iteration(cfg, runs): return MetaTemplate("\x1b[31mirreducible cflow\x1b[0m", bytecode.codeobj) except Exception: - pdb.xpm() # type: ignore + if hasattr(pdb, "xpm"): + pdb.xpm() # type: ignore raise return next(iter(cfg.nodes)) diff --git a/pylingual/main.py b/pylingual/main.py index 4790e44..ff8c76d 100644 --- a/pylingual/main.py +++ b/pylingual/main.py @@ -133,7 +133,8 @@ def main(files: list[str], out_dir: Path | None, config_file: Path | None, versi import pdb live.stop() - pdb.xpm() + if hasattr(pdb, "xpm"): + pdb.xpm() # type: ignore logger.exception(f"Failed to decompile {pyc_path}") console.rule()