def opcode_check(l):
"""When the version of Python we are running happens
to have the same opcode set as the opcode we are
importing, we perform checks to make sure our opcode
set matches exactly.
"""
# Python 2.6 reports 2.6000000000000001
if (abs(PYTHON_VERSION - l['python_version']) <= 0.01
and IS_PYPY == l['is_pypy']):
try:
import dis
opmap = fix_opcode_names(dis.opmap)
# print(set(opmap.items()) - set(l['opmap'].items()))
# print(set(l['opmap'].items()) - set(opmap.items()))
assert all(item in opmap.items() for item in l['opmap'].items())
assert all(item in l['opmap'].items() for item in opmap.items())
except:
import sys
评论列表
文章目录