File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
src/adaptix/_internal/type_tools
tests/unit/model_tools/introspection Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 55
66
77def _get_caller_module (stack_offset : int ):
8- return sys .modules [inspect .stack ()[stack_offset ].frame .f_globals ["__name__" ]]
8+ frame = inspect .currentframe ()
9+ if frame is None :
10+ raise RuntimeError ("This python implementation does not support inspect.currentframe()" )
11+
12+ for _ in range (stack_offset ):
13+ frame = frame .f_back
14+ if frame is None :
15+ raise RuntimeError ("Unexpected end of call stack" )
16+ return sys .modules [frame .f_globals ["__name__" ]]
917
1018
1119class FwdRefMarker (Enum ):
Original file line number Diff line number Diff line change @@ -356,6 +356,7 @@ def test_rename():
356356 )
357357 )
358358
359+
359360@requires (MAX_PY_314 )
360361def test_class_hinted_namedtuple ():
361362 BarA = NamedTuple ("BarA" , a = int , b = str )
You can’t perform that action at this time.
0 commit comments