Commit 3dd630d4 authored by Georg Brandl's avatar Georg Brandl

#6079: use 3k except syntax in examples.

parent a76a83d2
...@@ -343,7 +343,7 @@ The client code for the preceding server:: ...@@ -343,7 +343,7 @@ The client code for the preceding server::
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/") proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
try: try:
proxy.add(2, 5) proxy.add(2, 5)
except xmlrpc.client.Fault, err: except xmlrpc.client.Fault as err:
print("A fault occurred") print("A fault occurred")
print("Fault code: %d" % err.faultCode) print("Fault code: %d" % err.faultCode)
print("Fault string: %s" % err.faultString) print("Fault string: %s" % err.faultString)
...@@ -390,7 +390,7 @@ by providing an invalid URI:: ...@@ -390,7 +390,7 @@ by providing an invalid URI::
try: try:
proxy.some_method() proxy.some_method()
except xmlrpc.client.ProtocolError, err: except xmlrpc.client.ProtocolError as err:
print("A protocol error occurred") print("A protocol error occurred")
print("URL: %s" % err.url) print("URL: %s" % err.url)
print("HTTP/HTTPS headers: %s" % err.headers) print("HTTP/HTTPS headers: %s" % err.headers)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment