Message88162
The example is defined as:
import xmlrpc.client
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try:
proxy.add(2, 5)
except xmlrpc.client.Fault, err:
print("A fault occurred")
print("Fault code: %d" % err.faultCode)
print("Fault string: %s" % err.faultString)
Which throws the following error:
File "test.py", line 6
except xmlrpc.client.Fault, err:
^
SyntaxError: invalid syntax
I think it should be defined instead as:
import xmlrpc.client
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try:
proxy.add(2, 5)
except xmlrpc.client.Fault as err:
print("A fault occurred")
print("Fault code: %d" % err.faultCode)
print("Fault string: %s" % err.faultString) |
|
Date |
User |
Action |
Args |
2009-05-21 16:11:59 | thijs | set | recipients:
+ thijs, georg.brandl |
2009-05-21 16:11:59 | thijs | set | messageid: <1242922319.61.0.524994134376.issue6079@psf.upfronthosting.co.za> |
2009-05-21 16:11:58 | thijs | link | issue6079 messages |
2009-05-21 16:11:58 | thijs | create | |
|