summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-04-03 21:47:47 (GMT)
committerFred Drake <fdrake@acm.org>2002-04-03 21:47:47 (GMT)
commit71cc46e7e11b375d3023eb91988a9ebec868e511 (patch)
tree179a67422fabb6b70cd0014b0ce8fcc4e373facc
parentcd874edaaa9103ac0f28e588e2adfa21b1626d19 (diff)
downloadcpython-71cc46e7e11b375d3023eb91988a9ebec868e511.zip
cpython-71cc46e7e11b375d3023eb91988a9ebec868e511.tar.gz
cpython-71cc46e7e11b375d3023eb91988a9ebec868e511.tar.bz2
Slight modernization.
-rw-r--r--Demo/xmlrpc/xmlrpc_handler.py6
-rw-r--r--Demo/xmlrpc/xmlrpcserver.py2
2 files changed, 3 insertions, 5 deletions
diff --git a/Demo/xmlrpc/xmlrpc_handler.py b/Demo/xmlrpc/xmlrpc_handler.py
index 9fa1766..1935475 100644
--- a/Demo/xmlrpc/xmlrpc_handler.py
+++ b/Demo/xmlrpc/xmlrpc_handler.py
@@ -12,8 +12,6 @@
import http_server
import xmlrpclib
-import regex
-import string
import sys
class xmlrpc_handler:
@@ -43,7 +41,7 @@ class xmlrpc_handler:
except:
# report exception back to server
response = xmlrpclib.dumps (
- xmlrpclib.Fault (1, "%s:%s" % (sys.exc_type, sys.exc_value))
+ xmlrpclib.Fault (1, "%s:%s" % sys.exc_info()[:2])
)
else:
response = xmlrpclib.dumps (response, methodresponse=1)
@@ -76,7 +74,7 @@ class collector:
if not cl:
request.error (411)
else:
- cl = string.atoi (cl)
+ cl = int (cl)
# using a 'numeric' terminator
self.request.channel.set_terminator (cl)
diff --git a/Demo/xmlrpc/xmlrpcserver.py b/Demo/xmlrpc/xmlrpcserver.py
index fa30419..7af73be 100644
--- a/Demo/xmlrpc/xmlrpcserver.py
+++ b/Demo/xmlrpc/xmlrpcserver.py
@@ -42,7 +42,7 @@ class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
except:
# report exception back to server
response = xmlrpclib.dumps(
- xmlrpclib.Fault(1, "%s:%s" % (sys.exc_type, sys.exc_value))
+ xmlrpclib.Fault(1, "%s:%s" % sys.exc_info()[:2])
)
else:
response = xmlrpclib.dumps(