Summary
I do this in my code:
from __future__ import annotations
import pwndbg
def myfunc() -> None:
# note that dbg is an object in the pwndbg module
if pwndbg.dbg.is_gdblib_available():
import pwndbg.gdblib.functions
_ = pwndbg.gdblib.functions.functions
print("yes!")
else:
print("no!")
myfunc()
And I get the following:
~❯ uv run ruff check repro.py
F823 Local variable `pwndbg` referenced before assignment
--> repro.py:7:8
|
6 | def myfunc() -> None:
7 | if pwndbg.dbg.is_gdblib_available():
| ^^^^^^
8 | import pwndbg.gdblib.functions
9 | _ = pwndbg.gdblib.functions.functions
|
Found 1 error.
What is going on?
Repro
git clone https://github.com/k4lizen/pwndbg/
cd pwndbg
git checkout 4588a455f5e511b567458ef618eb627788b539d5
uv run --all-groups --all-extras ruff check repro.py
Version
ruff 0.14.10
Summary
I do this in my code:
And I get the following:
What is going on?
Repro
git clone https://github.com/k4lizen/pwndbg/ cd pwndbg git checkout 4588a455f5e511b567458ef618eb627788b539d5 uv run --all-groups --all-extras ruff check repro.pyVersion
ruff 0.14.10