1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
from Pyro5.api import expose, oneway
@expose
class TestClass(object):
def div(self, arg1, arg2):
return arg1 / arg2
def error(self):
raise ValueError('a valueerror! Great!')
def error2(self):
return ValueError('a valueerror! Great!')
def othererr(self):
raise RuntimeError('a runtime error!')
@oneway
def onewayerr(self):
raise ValueError('error in oneway call!')
def complexerror(self):
x = Foo()
x.crash()
def unserializable(self):
return TestClass.unserializable
class Foo(object):
def crash(self):
self.crash2('going down...')
def crash2(self, arg):
# this statement will crash on purpose:
x = arg // 2
|