fix python3 issues and add info to changelog
This commit is contained in:
@@ -7,6 +7,10 @@
|
||||
- introduce a new data input/output mechanism to allow the master side
|
||||
to send and receive data from a slave.
|
||||
|
||||
- use new register hooks facility of py.test>=1.2.2
|
||||
|
||||
- fix some python3 related pickling related race conditions
|
||||
|
||||
- fix PyPI description
|
||||
|
||||
1.1
|
||||
|
||||
@@ -252,3 +252,10 @@ class TestPickleChannelFunctional:
|
||||
channel.waitclose(timeout=2)
|
||||
|
||||
|
||||
|
||||
def test_explode():
|
||||
from xdist.mypickle import explode
|
||||
assert isinstance(explode({}.values()), list)
|
||||
l = []
|
||||
assert isinstance(explode(l), list)
|
||||
assert explode(l) is l
|
||||
|
||||
@@ -100,16 +100,25 @@ class ImmutablePickler:
|
||||
return res
|
||||
|
||||
def _updatepicklememo(self):
|
||||
for x, obj in self._unpicklememo.items():
|
||||
for x, obj in explode(self._unpicklememo.items()):
|
||||
self._picklememo[id(obj)] = (fromkey(x), obj)
|
||||
|
||||
def _updateunpicklememo(self):
|
||||
for key,obj in self._picklememo.values():
|
||||
for key,obj in explode(self._picklememo.values()):
|
||||
key = makekey(key)
|
||||
if key in self._unpicklememo:
|
||||
assert self._unpicklememo[key] is obj
|
||||
self._unpicklememo[key] = obj
|
||||
|
||||
def explode(obj):
|
||||
try:
|
||||
obj[0]
|
||||
except TypeError:
|
||||
return list(obj)
|
||||
except IndexError:
|
||||
pass
|
||||
return obj
|
||||
|
||||
NO_ENDMARKER_WANTED = object()
|
||||
|
||||
class UnpickleError(Exception):
|
||||
|
||||
Reference in New Issue
Block a user