File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11import sys
2+ import platform
23from opcode import opname
34
45
@@ -44,13 +45,13 @@ def get_var_name(depth=2, default=_raise_exception):
4445 return code .co_names [imm ]
4546 elif opc == "STORE_FAST" :
4647 imm |= int (code .co_code [index + 1 ])
47- if sys .version_info >= (3 , 11 ):
48+ if sys .version_info >= (3 , 11 ) and platform . python_implementation () == 'CPython' :
4849 return code ._varname_from_oparg (imm )
4950 else :
5051 return code .co_varnames [imm ]
5152 elif opc == "STORE_DEREF" :
5253 imm |= int (code .co_code [index + 1 ])
53- if sys .version_info >= (3 , 11 ):
54+ if sys .version_info >= (3 , 11 ) and platform . python_implementation () == 'CPython' :
5455 return code ._varname_from_oparg (imm )
5556 else :
5657 if imm < len (code .co_cellvars ):
You can’t perform that action at this time.
0 commit comments