______________ entrypoint: AppTestTermios().test_error_tcsetattr _______________
def runtraced(self, colitem):
if self.shouldclose():
raise Exit, "received external close signal"
outcome = None
colitem.startcapture()
try:
self.start(colitem)
try:
try:
if colitem._stickyfailure:
raise colitem._stickyfailure
> outcome = self.run(colitem)
/home/arigo/autotest/pypy-dist/py/test/session.py:84:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def run(self, colitem):
if self.config.option.collectonly and isinstance(colitem, py.test.collect.Item):
return
if isinstance(colitem, py.test.collect.Item):
colitem._skipbykeyword(self.config.option.keyword)
> res = colitem.run()
/home/arigo/autotest/pypy-dist/py/test/session.py:107:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def run(self):
""" setup and execute the underlying test function. """
self._state.prepare(self)
> self.execute(self.obj, *self._args)
/home/arigo/autotest/pypy-dist/py/test/item.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute(self, target, *args):
assert not args
if option.runappdirect:
return target(*args)
space = target.im_self.space
func = app2interp_temp(target.im_func)
w_instance = self.parent.w_instance
> self.execute_appex(space, func, space, w_instance)
/home/arigo/autotest/pypy-dist/pypy/conftest.py:363:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute_appex(self, space, target, *args):
try:
> target(*args)
/home/arigo/autotest/pypy-dist/pypy/conftest.py:275:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def appcaller(space, *args_w):
if not isinstance(space, ObjSpace):
raise TypeError("first argument must be a space instance.")
# redirect if the space handles this specially
# XXX can this be factored a bit less flow space dependently?
if hasattr(space, 'specialcases'):
sc = space.specialcases
if ApplevelClass in sc:
ret_w = sc[ApplevelClass](space, self, name, args_w)
if ret_w is not None: # it was RPython
return ret_w
# the last argument can be an Arguments
if not args_w:
args = Arguments(space, [])
else:
args = args_w[-1]
assert args is not None
if not isinstance(args, AbstractArguments):
args = Arguments(space, list(args_w))
else:
# ...which is merged with the previous arguments, if any
if len(args_w) > 1:
more_args_w, more_kwds_w = args.unpack()
args = Arguments(space,
list(args_w[:-1]) + more_args_w,
more_kwds_w)
w_func = self.wget(space, name)
> return space.call_args(w_func, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/gateway.py:839:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_args(space, w_obj, args):
# two special cases for performance
if isinstance(w_obj, Function):
> return w_obj.call_args(args)
/home/arigo/autotest/pypy-dist/pypy/objspace/descroperation.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_args(self, args):
# delegate activation to code
> return self.code.funcrun(self, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/function.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funcrun(self, func, args):
frame = self.space.createframe(self, func.w_func_globals,
func.closure)
sig = self._signature
# speed hack
args_matched = args.parse_into_scope(None, frame.fastlocals_w,
func.name,
sig, func.defs_w)
frame.init_cells()
> return frame.run()
/home/arigo/autotest/pypy-dist/pypy/interpreter/pycode.py:184:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def run(self):
"""Start this frame's execution."""
if self.pycode.co_flags & pycode.CO_GENERATOR:
from pypy.interpreter.generator import GeneratorIterator
return self.space.wrap(GeneratorIterator(self))
else:
> return self.execute_frame()
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyframe.py:91:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def execute_frame(self):
"""Execute this frame. Main entry point to the interpreter."""
from pypy.rlib import rstack
# the following 'assert' is an annotation hint: it hides from
# the annotator all methods that are defined in PyFrame but
# overridden in the FrameClass subclass of PyFrame.
assert isinstance(self, self.space.FrameClass)
executioncontext = self.space.getexecutioncontext()
executioncontext.enter(self)
try:
executioncontext.call_trace(self)
# Execution starts just after the last_instr. Initially,
# last_instr is -1. After a generator suspends it points to
# the YIELD_VALUE instruction.
next_instr = self.last_instr + 1
w_exitvalue = self.dispatch(self.pycode, next_instr,
> executioncontext)
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyframe.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def dispatch(self, pycode, next_instr, ec):
# For the sequel, force 'next_instr' to be unsigned for performance
from pypy.rlib import rstack # for resume points
next_instr = r_uint(next_instr)
co_code = pycode.co_code
try:
while True:
> next_instr = self.handle_bytecode(co_code, next_instr, ec)
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyopcode.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def handle_bytecode(self, co_code, next_instr, ec):
from pypy.rlib import rstack # for resume points
try:
> next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyopcode.py:89:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def dispatch_bytecode(self, co_code, next_instr, ec):
space = self.space
while True:
self.last_instr = intmask(next_instr)
if not we_are_jitted():
ec.bytecode_trace(self)
next_instr = r_uint(self.last_instr)
opcode = ord(co_code[next_instr])
next_instr += 1
if space.config.objspace.logbytecodes:
space.bytecodecounts[opcode] = space.bytecodecounts.get(opcode, 0) + 1
if opcode >= HAVE_ARGUMENT:
lo = ord(co_code[next_instr])
hi = ord(co_code[next_instr+1])
next_instr += 2
oparg = (hi << 8) | lo
else:
oparg = 0
hint(opcode, concrete=True)
hint(oparg, concrete=True)
while opcode == opcodedesc.EXTENDED_ARG.index:
opcode = ord(co_code[next_instr])
if opcode < HAVE_ARGUMENT:
raise BytecodeCorruption
lo = ord(co_code[next_instr+1])
hi = ord(co_code[next_instr+2])
next_instr += 3
oparg = (oparg << 16) | (hi << 8) | lo
hint(opcode, concrete=True)
hint(oparg, concrete=True)
if opcode == opcodedesc.RETURN_VALUE.index:
w_returnvalue = self.popvalue()
block = self.unrollstack(SReturnValue.kind)
if block is None:
self.pushvalue(w_returnvalue) # XXX ping pong
raise Return
else:
unroller = SReturnValue(w_returnvalue)
next_instr = block.handle(self, unroller)
return next_instr # now inside a 'finally' block
if opcode == opcodedesc.YIELD_VALUE.index:
#self.last_instr = intmask(next_instr - 1) XXX clean up!
raise Yield
if opcode == opcodedesc.END_FINALLY.index:
unroller = self.end_finally()
if isinstance(unroller, SuspendedUnroller):
# go on unrolling the stack
block = self.unrollstack(unroller.kind)
if block is None:
w_result = unroller.nomoreblocks()
self.pushvalue(w_result)
raise Return
else:
next_instr = block.handle(self, unroller)
return next_instr
if we_are_translated():
from pypy.rlib import rstack # for resume points
for opdesc in unrolling_opcode_descs:
# static checks to skip this whole case if necessary
if not opdesc.is_enabled(space):
continue
if not hasattr(pyframe.PyFrame, opdesc.methodname):
continue # e.g. for JUMP_FORWARD, implemented above
if opcode == opdesc.index:
# dispatch to the opcode method
meth = getattr(self, opdesc.methodname)
res = meth(oparg, next_instr)
if opdesc.index == opcodedesc.CALL_FUNCTION.index:
rstack.resume_point("dispatch_call", self, co_code, next_instr, ec)
# !! warning, for the annotator the next line is not
# comparing an int and None - you can't do that.
# Instead, it's constant-folded to either True or False
if res is not None:
next_instr = res
break
else:
self.MISSING_OPCODE(oparg, next_instr)
else: # when we are not translated, a list lookup is much faster
methodname = opcode_method_names[opcode]
> res = getattr(self, methodname)(oparg, next_instr)
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyopcode.py:237:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def CALL_FUNCTION(f, oparg, *ignored):
from pypy.rlib import rstack # for resume points
# XXX start of hack for performance
if (oparg >> 8) & 0xff == 0:
# Only positional arguments
nargs = oparg & 0xff
w_function = f.peekvalue(nargs)
try:
> w_result = f.space.call_valuestack(w_function, nargs, f)
/home/arigo/autotest/pypy-dist/pypy/interpreter/pyopcode.py:882:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_valuestack(self, w_func, nargs, frame):
if not self.config.objspace.disable_call_speedhacks:
# XXX start of hack for performance
from pypy.interpreter.function import Function, Method
hint(w_func.__class__, promote=True)
if isinstance(w_func, Method):
w_inst = w_func.w_instance
if w_inst is not None:
w_func = w_func.w_function
# reuse callable stack place for w_inst
frame.settopvalue(w_inst, nargs)
nargs += 1
elif nargs > 0 and (
self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-(
w_func.w_class)):
w_func = w_func.w_function
if isinstance(w_func, Function):
> return w_func.funccall_valuestack(nargs, frame)
/home/arigo/autotest/pypy-dist/pypy/interpreter/baseobjspace.py:733:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funccall_valuestack(self, nargs, frame): # speed hack
from pypy.interpreter import gateway
from pypy.interpreter.pycode import PyCode
code = self.getcode() # hook for the jit
fast_natural_arity = code.fast_natural_arity
if nargs == fast_natural_arity:
if nargs == 0:
assert isinstance(code, gateway.BuiltinCode0)
return code.fastcall_0(self.space, self)
elif nargs == 1:
assert isinstance(code, gateway.BuiltinCode1)
return code.fastcall_1(self.space, self, frame.peekvalue(0))
elif nargs == 2:
assert isinstance(code, gateway.BuiltinCode2)
return code.fastcall_2(self.space, self, frame.peekvalue(1),
frame.peekvalue(0))
elif nargs == 3:
assert isinstance(code, gateway.BuiltinCode3)
return code.fastcall_3(self.space, self, frame.peekvalue(2),
frame.peekvalue(1), frame.peekvalue(0))
elif nargs == 4:
assert isinstance(code, gateway.BuiltinCode4)
return code.fastcall_4(self.space, self, frame.peekvalue(3),
frame.peekvalue(2), frame.peekvalue(1),
frame.peekvalue(0))
elif (nargs|PyCode.FLATPYCALL) == fast_natural_arity:
assert isinstance(code, PyCode)
return self._flat_pycall(code, nargs, frame)
elif fast_natural_arity == -1 and nargs >= 1:
assert isinstance(code, gateway.BuiltinCodePassThroughArguments1)
w_obj = frame.peekvalue(nargs-1)
args = frame.make_arguments(nargs-1)
try:
return code.funcrun_obj(self, w_obj, args)
finally:
if isinstance(args, ArgumentsFromValuestack):
args.frame = None
args = frame.make_arguments(nargs)
try:
> return self.call_args(args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/function.py:131:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_args(self, args):
# delegate activation to code
> return self.code.funcrun(self, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/function.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/gateway.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
/home/arigo/autotest/pypy-dist/pypy/interpreter/gateway.py:491:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _run_UWS_ObjSpace_W_Root_W_Root_Arguments(self, space, scope_w):
> return self.behavior(space, scope_w[0], scope_w[1], Arguments.frompacked(space, scope_w[2], scope_w[3]))
/home/arigo/autotest/pypy-dist/pypy/</home/arigo/autotest/pypy-dist/py/code/source.py:213>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def pypyraises(space, w_ExpectedException, w_expr, __args__):
"""A built-in function providing the equivalent of py.test.raises()."""
args_w, kwds_w = __args__.unpack()
if space.is_true(space.isinstance(w_expr, space.w_str)):
if args_w:
raise OperationError(space.w_TypeError,
space.wrap("raises() takes no argument "
"after a string expression"))
expr = space.unwrap(w_expr)
source = py.code.Source(expr)
frame = space.getexecutioncontext().framestack.top()
w_locals = frame.getdictscope()
w_locals = space.call_method(w_locals, 'copy')
for key, w_value in kwds_w.items():
space.setitem(w_locals, space.wrap(key), w_value)
try:
space.exec_(str(source), frame.w_globals, w_locals)
except OperationError, e:
if e.match(space, w_ExpectedException):
return space.sys.call('exc_info')
raise
else:
try:
> space.call_args(w_expr, __args__)
/home/arigo/autotest/pypy-dist/pypy/tool/pytest/appsupport.py:194:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_args(space, w_obj, args):
# two special cases for performance
if isinstance(w_obj, Function):
> return w_obj.call_args(args)
/home/arigo/autotest/pypy-dist/pypy/objspace/descroperation.py:98:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def call_args(self, args):
# delegate activation to code
> return self.code.funcrun(self, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/function.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funcrun(self, func, args):
> return BuiltinCode.funcrun_obj(self, func, None, args)
/home/arigo/autotest/pypy-dist/pypy/interpreter/gateway.py:483:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def funcrun_obj(self, func, w_obj, args):
space = func.space
activation = self.activation
scope_w = args.parse_obj(w_obj, func.name, self.sig,
func.defs_w, self.minargs)
try:
> w_result = activation._run(space, scope_w)
/home/arigo/autotest/pypy-dist/pypy/interpreter/gateway.py:491:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def _run_UWS_ObjSpace_int_int_W_Root(self, space, scope_w):
> return self.behavior(space, space.int_w(scope_w[0]), space.int_w(scope_w[1]), scope_w[2])
/home/arigo/autotest/pypy-dist/pypy/</home/arigo/autotest/pypy-dist/py/code/source.py:213>:3:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def tcsetattr(space, fd, when, w_attributes):
from pypy.interpreter.baseobjspace import UnpackValueError
try:
> w_iflag, w_oflag, w_cflag, w_lflag, w_ispeed, w_ospeed, w_cc = \
space.unpackiterable(w_attributes, expected_length=7)
/home/arigo/autotest/pypy-dist/pypy/module/termios/interp_termios.py:33:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
def unpackiterable(self, w_obj, expected_length=-1):
if isinstance(w_obj, W_TupleObject):
t = w_obj.wrappeditems[:]
elif isinstance(w_obj, W_ListObject):
t = w_obj.wrappeditems[:]
else:
return ObjSpace.unpackiterable(self, w_obj, expected_length)
if expected_length != -1 and len(t) != expected_length:
E raise ValueError("Expected length %d, got %d" % (expected_length, len(t)))
> ValueError: Expected length 7, got 2
/home/arigo/autotest/pypy-dist/pypy/objspace/std/objspace.py:644: ValueError
________________________________________________________________________________