Commit d61438a9 authored by Benjamin Peterson's avatar Benjamin Peterson

make changes for py3k for multiprocessing

parent 1fcfe211
...@@ -41,7 +41,7 @@ def reduce_array(a): ...@@ -41,7 +41,7 @@ def reduce_array(a):
copyreg.pickle(array.array, reduce_array) copyreg.pickle(array.array, reduce_array)
view_types = [type(getattr({}, name)()) for name in ('items','keys','values')] view_types = [type(getattr({}, name)()) for name in ('items','keys','values')]
if view_types[0] is not list: # XXX only needed in Py3.0 if view_types[0] is not list: # only needed in Py3.0
def rebuild_as_list(obj): def rebuild_as_list(obj):
return list, (list(obj),) return list, (list(obj),)
for view_type in view_types: for view_type in view_types:
...@@ -930,14 +930,11 @@ def Array(typecode, sequence, lock=True): ...@@ -930,14 +930,11 @@ def Array(typecode, sequence, lock=True):
# #
class IteratorProxy(BaseProxy): class IteratorProxy(BaseProxy):
# XXX remove methods for Py3.0 and Py2.6 _exposed_ = ('__next__', 'send', 'throw', 'close')
_exposed_ = ('__next__', 'next', 'send', 'throw', 'close')
def __iter__(self): def __iter__(self):
return self return self
def __next__(self, *args): def __next__(self, *args):
return self._callmethod('__next__', args) return self._callmethod('__next__', args)
def next(self, *args):
return self._callmethod('next', args)
def send(self, *args): def send(self, *args):
return self._callmethod('send', args) return self._callmethod('send', args)
def throw(self, *args): def throw(self, *args):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment