Skip to content
Commit 945ca296 authored by Douglas Raillard's avatar Douglas Raillard
Browse files

lisa.utils: Fix inspect.getsource() for newtype() in Python 3.13

FIX

Python 3.13 inspect.getsource() uses the new __firstlineno__ attribute
that allows getting the first line number of the class declaration.
Unfortunately, this was set to the location inside newtype where the
class is actually created, leading to problems in Sphinx autodoc.

Set the __firstlineno__ attribute manually to the newtype() caller's
location to preseve accurate source location.
parent d67e1a10
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment