def RAISE_VARARGS(ctx: _VSContext, instruction: dis.Instruction):
"""
Raises an exception to either the current scope or the outer scope.
"""
# This is relatively simple.
# We ignore the argc == 3, and pretend it's argc == 2
argc = instruction.arg
if argc == 3:
# fuck you
ctx.pop()
argc = 2
if argc == 2:
# FROM exception is Top of stack now.
fr = ctx.pop()
# The real exception is top of stack now.
exc = ctx.pop()
exc.__cause__ = fr
elif argc == 1:
exc = ctx.pop()
else:
# Bare raise.
exc = ctx._exception_state
# Inject the exception.
safe_raise(ctx, exc)
# Raise the exception.
return exc
# endregion
评论列表
文章目录