traceback manipulation

Wolfgang Draxinger wdraxinger at darkstargames.de
Sun Dec 8 10:48:53 EST 2002


I implemented a small SSL remote procedure call class (RPC) which allows 
  excecution of every python function with any parameter form you want.

e.g.

# server
def test(a, b, c):
	print a, b, c
	return a+b*c

import RPC
rpcd=RPC.RPCd(1234) # create RPC deamon on port 1234
rpcd.add_proc("test", test)

#client
import RPC
rpc=RPC.RPC(("localhost", 1234))
print rpc.call("test", (1, 2, 3))

exceuting it will output
- on the server: 1 2 3
- on the client: 7

If a exception occours, the daemon catches it and the client it 
re-raising it. However in the traceback on the client I only see the 
line in the client code, that re-raises the exception
( exec "raise %s, '%s'" % (type, string) )
However I'd like to replace the traceback with the server's one...

Any ideas?

-- 
+------------------------------------------------+
| +----------------+ WOLFGANG DRAXINGER          |
| | ,-.   DARKSTAR | lead programmer             |
| |(   ) +---------+ wdraxinger at darkstargames.de |
| | `-' / GAMES /                                |
| +----+''''''''     http://www.darkstargames.de |
+------------------------------------------------+




More information about the Python-list mailing list