コード例 #1
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     try:
         x.get_Item(0)
         return "Impossible!"
     except SystemException, e:
         ex = native_exc(e)
         return ex.get_Message()
コード例 #2
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     try:
         x.get_Item(0)
         return "Impossible!"
     except SystemException, e:
         ex = native_exc(e)
         return ex.get_Message()
コード例 #3
0
ファイル: interp_clr.py プロジェクト: sota/pypy
def call_method(space, b_obj, b_type, name, w_args, startfrom):
    b_args, b_paramtypes = rewrap_args(space, w_args, startfrom)
    b_meth = get_method(space, b_type, name, b_paramtypes)
    try:
        # for an explanation of the box() call, see the log message for revision 35167
        b_res = box(b_meth.Invoke(b_obj, b_args))
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #4
0
ファイル: interp_clr.py プロジェクト: sota/pypy
def cli_object_new(space, w_subtype, typename, w_args):
    b_type = System.Type.GetType(typename)
    b_args, b_paramtypes = rewrap_args(space, w_args, 0)
    b_ctor = get_constructor(space, b_type, b_paramtypes)
    try:
        b_obj = b_ctor.Invoke(b_args)
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #5
0
ファイル: interp_clr.py プロジェクト: sota/pypy-old
def call_method(space, b_obj, b_type, name, w_args, startfrom):
    b_args, b_paramtypes = rewrap_args(space, w_args, startfrom)
    b_meth = get_method(space, b_type, name, b_paramtypes)
    try:
        # for an explanation of the box() call, see the log message for revision 35167
        b_res = box(b_meth.Invoke(b_obj, b_args))
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #6
0
ファイル: interp_clr.py プロジェクト: sota/pypy-old
def cli_object_new(space, w_subtype, typename, w_args):
    b_type = System.Type.GetType(typename)
    b_args, b_paramtypes = rewrap_args(space, w_args, 0)
    b_ctor = get_constructor(space, b_type, b_paramtypes)
    try:
        b_obj = b_ctor.Invoke(b_args)
    except TargetInvocationException, e:
        b_inner = native_exc(e).get_InnerException()
        message = str(b_inner.get_Message())
        # TODO: use the appropriate exception, not StandardError
        raise OperationError(space.w_StandardError, space.wrap(message))
コード例 #7
0
ファイル: test_dotnet.py プロジェクト: sota/pypy-old
 def fn():
     x = ArrayList()
     t = x.GetType()
     meth = t.GetMethod('get_Item')
     args = init_array(System.Object, box(0))
     try:
         meth.Invoke(x, args)
         return "Impossible!"
     except TargetInvocationException, e:
         inner = native_exc(e).get_InnerException()
         message = str(inner.get_Message())
         return message
コード例 #8
0
ファイル: test_dotnet.py プロジェクト: sota/pypy
 def fn():
     x = ArrayList()
     t = x.GetType()
     meth = t.GetMethod('get_Item')
     args = init_array(System.Object, box(0))
     try:
         meth.Invoke(x, args)
         return "Impossible!"
     except TargetInvocationException, e:
         inner = native_exc(e).get_InnerException()
         message = str(inner.get_Message())
         return message