mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Slight modernization.
This commit is contained in:
parent
cd874edaaa
commit
71cc46e7e1
2 changed files with 3 additions and 5 deletions
|
|
@ -12,8 +12,6 @@
|
|||
import http_server
|
||||
import xmlrpclib
|
||||
|
||||
import regex
|
||||
import string
|
||||
import sys
|
||||
|
||||
class xmlrpc_handler:
|
||||
|
|
@ -43,7 +41,7 @@ def continue_request (self, data, request):
|
|||
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 @@ def __init__ (self, handler, request):
|
|||
if not cl:
|
||||
request.error (411)
|
||||
else:
|
||||
cl = string.atoi (cl)
|
||||
cl = int (cl)
|
||||
# using a 'numeric' terminator
|
||||
self.request.channel.set_terminator (cl)
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ def do_POST(self):
|
|||
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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue