mirror of
https://github.com/python/cpython.git
synced 2025-09-14 12:46:49 +00:00

svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88546 | alexander.belopolsky | 2011-02-24 14:40:09 -0500 (Thu, 24 Feb 2011) | 3 lines Issue #11286: Fixed unpickling of empty 2.x strings. ........
24 lines
611 B
Python
24 lines
611 B
Python
import pickle
|
|
import pickletools
|
|
from test import test_support
|
|
from test.pickletester import AbstractPickleTests
|
|
from test.pickletester import AbstractPickleModuleTests
|
|
|
|
class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
|
|
|
|
def dumps(self, arg, proto=0, fast=0):
|
|
return pickletools.optimize(pickle.dumps(arg, proto))
|
|
|
|
def loads(self, buf):
|
|
return pickle.loads(buf)
|
|
|
|
module = pickle
|
|
error = KeyError
|
|
|
|
def test_main():
|
|
test_support.run_unittest(OptimizedPickleTests)
|
|
test_support.run_doctest(pickletools)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
test_main()
|