Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0dedf45

Browse files
committed
#6079: use 3k except syntax in examples.
1 parent fe5f409 commit 0dedf45

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/xmlrpc.client.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ The client code for the preceding server::
343343
proxy = xmlrpc.client.ServerProxy("http://localhost:8000/")
344344
try:
345345
proxy.add(2, 5)
346-
except xmlrpc.client.Fault, err:
346+
except xmlrpc.client.Fault as err:
347347
print("A fault occurred")
348348
print("Fault code: %d" % err.faultCode)
349349
print("Fault string: %s" % err.faultString)
@@ -390,7 +390,7 @@ by providing an invalid URI::
390390

391391
try:
392392
proxy.some_method()
393-
except xmlrpc.client.ProtocolError, err:
393+
except xmlrpc.client.ProtocolError as err:
394394
print("A protocol error occurred")
395395
print("URL: %s" % err.url)
396396
print("HTTP/HTTPS headers: %s" % err.headers)

0 commit comments

Comments
 (0)