mirror of https://github.com/python/cpython.git
add a little debugging support when new.code raises SystemError
This commit is contained in:
parent
ae3d79208f
commit
410e840c85
|
@ -140,11 +140,27 @@ def makeCodeObject(self):
|
||||||
if self.flags & CO_VARKEYWORDS:
|
if self.flags & CO_VARKEYWORDS:
|
||||||
self.argcount = self.argcount - 1
|
self.argcount = self.argcount - 1
|
||||||
stacksize = findDepth(self.insts)
|
stacksize = findDepth(self.insts)
|
||||||
co = new.code(self.argcount, nlocals, stacksize,
|
try:
|
||||||
self.flags, lnotab.getCode(), self._getConsts(),
|
co = new.code(self.argcount, nlocals, stacksize,
|
||||||
tuple(self.names), tuple(self.varnames),
|
self.flags, lnotab.getCode(), self._getConsts(),
|
||||||
self.filename, self.name, self.firstlineno,
|
tuple(self.names), tuple(self.varnames),
|
||||||
lnotab.getTable())
|
self.filename, self.name, self.firstlineno,
|
||||||
|
lnotab.getTable())
|
||||||
|
except SystemError, err:
|
||||||
|
print err
|
||||||
|
print repr(self.argcount)
|
||||||
|
print repr(nlocals)
|
||||||
|
print repr(stacksize)
|
||||||
|
print repr(self.flags)
|
||||||
|
print repr(lnotab.getCode())
|
||||||
|
print repr(self._getConsts())
|
||||||
|
print repr(self.names)
|
||||||
|
print repr(self.varnames)
|
||||||
|
print repr(self.filename)
|
||||||
|
print repr(self.name)
|
||||||
|
print repr(self.firstlineno)
|
||||||
|
print repr(lnotab.getTable())
|
||||||
|
raise
|
||||||
return co
|
return co
|
||||||
|
|
||||||
def _getConsts(self):
|
def _getConsts(self):
|
||||||
|
|
|
@ -140,11 +140,27 @@ def makeCodeObject(self):
|
||||||
if self.flags & CO_VARKEYWORDS:
|
if self.flags & CO_VARKEYWORDS:
|
||||||
self.argcount = self.argcount - 1
|
self.argcount = self.argcount - 1
|
||||||
stacksize = findDepth(self.insts)
|
stacksize = findDepth(self.insts)
|
||||||
co = new.code(self.argcount, nlocals, stacksize,
|
try:
|
||||||
self.flags, lnotab.getCode(), self._getConsts(),
|
co = new.code(self.argcount, nlocals, stacksize,
|
||||||
tuple(self.names), tuple(self.varnames),
|
self.flags, lnotab.getCode(), self._getConsts(),
|
||||||
self.filename, self.name, self.firstlineno,
|
tuple(self.names), tuple(self.varnames),
|
||||||
lnotab.getTable())
|
self.filename, self.name, self.firstlineno,
|
||||||
|
lnotab.getTable())
|
||||||
|
except SystemError, err:
|
||||||
|
print err
|
||||||
|
print repr(self.argcount)
|
||||||
|
print repr(nlocals)
|
||||||
|
print repr(stacksize)
|
||||||
|
print repr(self.flags)
|
||||||
|
print repr(lnotab.getCode())
|
||||||
|
print repr(self._getConsts())
|
||||||
|
print repr(self.names)
|
||||||
|
print repr(self.varnames)
|
||||||
|
print repr(self.filename)
|
||||||
|
print repr(self.name)
|
||||||
|
print repr(self.firstlineno)
|
||||||
|
print repr(lnotab.getTable())
|
||||||
|
raise
|
||||||
return co
|
return co
|
||||||
|
|
||||||
def _getConsts(self):
|
def _getConsts(self):
|
||||||
|
|
Loading…
Reference in New Issue