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 1
1
import sys
2
+ import platform
2
3
from opcode import opname
3
4
4
5
@@ -44,13 +45,13 @@ def get_var_name(depth=2, default=_raise_exception):
44
45
return code .co_names [imm ]
45
46
elif opc == "STORE_FAST" :
46
47
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' :
48
49
return code ._varname_from_oparg (imm )
49
50
else :
50
51
return code .co_varnames [imm ]
51
52
elif opc == "STORE_DEREF" :
52
53
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' :
54
55
return code ._varname_from_oparg (imm )
55
56
else :
56
57
if imm < len (code .co_cellvars ):
You can’t perform that action at this time.
0 commit comments