Home - Summaries: (main) : (py3.11) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/interpreter/test/test_main.py::TestMain::()::test_run_module

self = <pypy.interpreter.test.test_main.TestMain instance at 0x00007fca111fb360>

    def test_run_module(self):
        checkoutput(self.space, testresultoutput, main.run_module,
>                   testmodule, ['hello world'])

interpreter/test/test_main.py:79: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
interpreter/test/test_main.py:36: in checkoutput
    f(*(args + (space,)))
interpreter/main.py:93: in run_module
    runpy = space.call_function(w_import, space.newtext('runpy'))
interpreter/baseobjspace.py:1237: in call_function
    return w_func.funccall(*args_w)
interpreter/function.py:137: in funccall
    return self.call_args(Arguments(self.space, list(args_w)))
interpreter/function.py:81: in call_args
    w_res = self.getcode().funcrun(self, args)
interpreter/gateway.py:869: in funcrun
    return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter/gateway.py:884: in funcrun_obj
    self.handle_exception(space, e)
interpreter/gateway.py:878: in funcrun_obj
    w_result = activation._run(space, scope_w)
<2174-codegen /Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/tool/sourcetools.py:200>:3: in _run
    return self.behavior(space, scope_w[0], scope_w[1], scope_w[2], scope_w[3], scope_w[4])
module/_frozen_importlib/interp_import.py:96: in interp___import__
    w_level)
interpreter/baseobjspace.py:1241: in call_function
    return self.call_args(w_func, args)
objspace/descroperation.py:192: in call_args
    return w_obj.call_args(args)
interpreter/function.py:81: in call_args
    w_res = self.getcode().funcrun(self, args)
interpreter/pycode.py:280: in funcrun
    return frame.run(func.name, func.qualname)
interpreter/pyframe.py:256: in run
    return self.execute_frame()
interpreter/pyframe.py:349: in execute_frame
    executioncontext)
interpreter/pyopcode.py:68: in dispatch
    next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:91: in handle_bytecode
    next_instr = self.handle_operation_error(ec, operr)
interpreter/pyopcode.py:74: in handle_bytecode
    next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:307: in dispatch_bytecode
    self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1399: in CALL_FUNCTION
    w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1264: in call_valuestack
    nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:193: in funccall_valuestack
    natural_arity - nargs, dropvalues)
interpreter/function.py:231: in _flat_pycall_defaults
    return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:256: in run
    return self.execute_frame()
interpreter/pyframe.py:349: in execute_frame
    executioncontext)
interpreter/pyopcode.py:68: in dispatch
    next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:91: in handle_bytecode
    next_instr = self.handle_operation_error(ec, operr)
interpreter/pyopcode.py:74: in handle_bytecode
    next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:307: in dispatch_bytecode
    self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1399: in CALL_FUNCTION
    w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1264: in call_valuestack
    nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:187: in funccall_valuestack
    return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:214: in _flat_pycall
    return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:256: in run
    return self.execute_frame()
interpreter/pyframe.py:349: in execute_frame
    executioncontext)
interpreter/pyopcode.py:68: in dispatch
    next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:95: in handle_bytecode
    reraise_lasti=e.lasti)
interpreter/pyopcode.py:74: in handle_bytecode
    next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:245: in dispatch_bytecode
    return self.RERAISE(oparg, next_instr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object _find_and_load, file "<frozen importlib._bootstrap>", line 1165> at line 1176
oparg = 1, next_instr = 122L

    def RERAISE(self, oparg, next_instr):
        # CPython 3.11 RERAISE N semantics: if N > 0, read the lasti (int)
        # from PEEK(N + 1) [i.e., N slots below TOS after pushing exc], set
        # self.last_instr to it so the re-raised exception's traceback/lineno
        # reflect the original raise site, then pop the exception and raise.
        # N == 0 is a plain reraise of TOS.  Stack before: [..., lasti, exc]
        # for N == 1; after: [..., lasti].  The surrounding handler is
        # expected to have already done its POP_EXCEPT if sys.exc_info needs
        # restoring (PyPy no longer bundles POP_EXCEPT into RERAISE 1).
        if oparg:
            # PEEK(oparg + 1): 0 == TOS (exc), oparg is the lasti slot.
            # Pass via RaiseWithExplicitTraceback rather than self.last_instr:
            # the table lookup must use the RERAISE site offset, not lasti.
            reraise_lasti = self.space.int_w(self.peekvalue(oparg))
        else:
            reraise_lasti = -1
        w_exc = self.popvalue()
        from pypy.module.exceptions.interp_exceptions import W_BaseException
        space = self.space
        w_value = space.interp_w(W_BaseException, w_exc)
        w_type = space.type(w_exc)
        operr = OperationError(w_type, w_exc, w_value.w_traceback)
        # Raise as RaiseWithExplicitTraceback so that handle_bytecode
        # dispatches via its 'except RaiseWithExplicitTraceback' branch
        # (calling handle_operation_error with attach_tb=False).  This
        # avoids a spurious traceback entry and exception_trace call that
        # would occur if the OperationError bubbled up to the plain
        # 'except OperationError' branch in handle_bytecode.
>       raise RaiseWithExplicitTraceback(operr, reraise_lasti)
E       OperationError: [<W_TypeObject 'SyntaxError' at 0x7fc9b01fe1a8>: W_SyntaxError([W_UnicodeObject("Non-UTF-8 code starting with '\\xe2'"), W_TupleObject(W_UnicodeObject('/Users/matti/build-worker-x86_64/own-macos-x86-64/build/lib-python/3/runpy.py'), W_IntObject(224), W_IntObject(8), W_UnicodeObject('    """\n'), W_IntObject(224), W_IntObject(8))])]

interpreter/pyopcode.py:1393: OperationError
builder: own-macos-x86-64 build #1268+
test: pypy/interpreter/test/test_main.py::TestMain::()::test_run_module