Message180669
| Author |
eli.bendersky |
| Recipients |
Arfrever, asvetlov, danielsh, eli.bendersky, eric.snow, r.david.murray |
| Date |
2013年01月26日.13:46:48 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1359208008.52.0.922836453849.issue16817@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Eric, yes the key code in test_xml_etree that handles this is:
def pickleRoundTrip(self, obj, name, dumper, loader):
save_m = sys.modules[name]
try:
sys.modules[name] = dumper
temp = pickle.dumps(obj)
sys.modules[name] = loader
result = pickle.loads(temp)
except pickle.PicklingError as pe:
# pyET must be second, because pyET may be (equal to) ET.
human = dict([(ET, "cET"), (pyET, "pyET")])
raise support.TestFailed("Failed to round-trip %r from %r to %r"
% (obj,
human.get(dumper, dumper),
human.get(loader, loader))) from pe
finally:
sys.modules[name] = save_m
return result
Because pickle does its own import of ElementTree.
The test___all__ problem should be solved by a patch to issue #1674555, but having a separate mechanism in test.support was discussed. I'll take a look at your decorator. |
|