From: Georg Brandl Date: Fri, 22 May 2009 16:44:06 +0000 (+0000) Subject: #6079: use 3k except syntax in examples. X-Git-Tag: v3.1rc1~86 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0dedf451428c174db89963a74e6c230420c811e4;p=python #6079: use 3k except syntax in examples. --- diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst index 69cf4b572f..16014308b9 100644 --- a/Doc/library/xmlrpc.client.rst +++ b/Doc/library/xmlrpc.client.rst @@ -343,7 +343,7 @@ The client code for the preceding server:: proxy = xmlrpc.client.ServerProxy("http://localhost:8000/") try: proxy.add(2, 5) - except xmlrpc.client.Fault, err: + except xmlrpc.client.Fault as err: print("A fault occurred") print("Fault code: %d" % err.faultCode) print("Fault string: %s" % err.faultString) @@ -390,7 +390,7 @@ by providing an invalid URI:: try: proxy.some_method() - except xmlrpc.client.ProtocolError, err: + except xmlrpc.client.ProtocolError as err: print("A protocol error occurred") print("URL: %s" % err.url) print("HTTP/HTTPS headers: %s" % err.headers)