在python中,"SystemError: com_backpatch: offset too large"
在执行由以下内容生成的代码时抛出:
f = open("test.py", "w")
f.write("def fn():\n a =1000\n")
for a in xrange(3000):
if a == 0:
f.write(" if a == "+str(a)+": \n print "+str(a)+"\n")
else:
f.write(" elif a == "+str(a)+": \n print "+str(a)+"\n")
f.close()
import test
很明显,如果length语句超出了某个长度,就会抛出这个错误。在
有人能对这个错误有更深入的了解吗?在
看起来你已经达到了python解释器的限制。从if开始到结束的分支似乎太远了,可能是因为偏移量被限制在16位。如果将“elif”改为“If”,那么问题就消失了。在
您需要减小“if/elif”链的大小。在
嗨
……里奇
JFYI,这个脚本在一个有32位用户空间、内核和python2.5.4的Debian测试主机上工作。在
据此:http://www.cgl.ucsf.edu/pipermail/chimera-dev/2007/000404.html
更多详细信息:http://www.mail-archive.com/python-list@python.org/msg72631.html
相关问题 更多 >
编程相关推荐