File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -255,8 +255,16 @@ def lookup(name):
255255 if name in names :
256256 i = list (names ).index (name )
257257 if i is not None :
258- if PY2 or sys .hexversion >= 0x030b0000 : # 3.12.0
259- return (1 , func_code .co_consts [i + 1 ])
258+ # Python 3.11 moved qualified name into code object
259+ # https://github.com/python/cpython/pull/26941
260+ # commit 2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f
261+ if PY2 or sys .hexversion >= 0x030b0000 :
262+ # Python 3.14 added CO_HAS_DOCSTRING (0x4000000)
263+ # https://github.com/python/cpython/issues/126072
264+ # https://github.com/python/cpython/pull/126101
265+ # commit 35df4eb959b3923c08aaaeff728c5ed1706f31cf
266+ offset = 1 if sys .hexversion < 0x030e0000 or (func_code .co_flags & 0x4000000 ) != 0 else 0
267+ return (1 , func_code .co_consts [offset + i ])
260268 else :
261269 return (1 , func_code .co_consts [1 + i * 2 ])
262270
You can’t perform that action at this time.
0 commit comments