mirror of
https://github.com/python/cpython
synced 2024-10-14 20:45:19 +00:00
SF patch #834015: Remove imports of unused modules
(Contributed by George Yoshida.)
This commit is contained in:
parent
dc113a8a06
commit
cc523fc53d
|
@ -104,7 +104,6 @@ def export_add(self, x, y):
|
|||
import SocketServer
|
||||
import BaseHTTPServer
|
||||
import sys
|
||||
import types
|
||||
import os
|
||||
|
||||
def resolve_dotted_attribute(obj, attr):
|
||||
|
|
|
@ -1082,7 +1082,6 @@ def _sys_version():
|
|||
|
||||
"""
|
||||
global _sys_version_cache
|
||||
import time
|
||||
|
||||
if _sys_version_cache is not None:
|
||||
return _sys_version_cache
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
for manipulation of the pathname component of URLs.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
import stat
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
"""
|
||||
|
||||
import linecache
|
||||
import marshal
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
|
|
@ -109,7 +109,7 @@
|
|||
|
||||
ServerProxy Represents a logical connection to an XML-RPC server
|
||||
|
||||
MultiCall Executor of boxcared xmlrpc requests
|
||||
MultiCall Executor of boxcared xmlrpc requests
|
||||
Boolean boolean wrapper to generate a "boolean" XML-RPC value
|
||||
DateTime dateTime wrapper for an ISO 8601 string or time tuple or
|
||||
localtime integer value to generate a "dateTime.iso8601"
|
||||
|
@ -894,7 +894,7 @@ def __call__(self, *args):
|
|||
def MultiCallIterator(results):
|
||||
"""Iterates over the results of a multicall. Exceptions are
|
||||
thrown in response to xmlrpc faults."""
|
||||
|
||||
|
||||
for i in results:
|
||||
if type(i) == type({}):
|
||||
raise Fault(i['faultCode'], i['faultString'])
|
||||
|
@ -903,7 +903,7 @@ def MultiCallIterator(results):
|
|||
else:
|
||||
raise ValueError,\
|
||||
"unexpected type in multicall result"
|
||||
|
||||
|
||||
class MultiCall:
|
||||
"""server -> a object used to boxcar method calls
|
||||
|
||||
|
@ -920,14 +920,14 @@ class MultiCall:
|
|||
|
||||
add_result, address = multicall()
|
||||
"""
|
||||
|
||||
|
||||
def __init__(self, server):
|
||||
self.__server = server
|
||||
self.__call_list = []
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return "<MultiCall at %x>" % id(self)
|
||||
|
||||
|
||||
__str__ = __repr__
|
||||
|
||||
def __getattr__(self, name):
|
||||
|
@ -939,7 +939,7 @@ def __call__(self):
|
|||
marshalled_list.append({'methodName' : name, 'params' : args})
|
||||
|
||||
return MultiCallIterator(self.__server.system.multicall(marshalled_list))
|
||||
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
# convenience functions
|
||||
|
||||
|
@ -1071,7 +1071,6 @@ def loads(data):
|
|||
If the XML-RPC packet represents a fault condition, this function
|
||||
raises a Fault exception.
|
||||
"""
|
||||
import sys
|
||||
p, u = getparser()
|
||||
p.feed(data)
|
||||
p.close()
|
||||
|
@ -1392,7 +1391,7 @@ def __repr__(self):
|
|||
)
|
||||
|
||||
__str__ = __repr__
|
||||
|
||||
|
||||
def __getattr__(self, name):
|
||||
# magic method dispatcher
|
||||
return _Method(self.__request, name)
|
||||
|
|
Loading…
Reference in a new issue