Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
8ae7a5c1
Commit
8ae7a5c1
authored
Jun 08, 2013
by
Tres Seaver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Suppress protocol 3 pickle tests on Python2.
parent
935be033
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
src/ZODB/_compat.py
src/ZODB/_compat.py
+7
-1
src/ZODB/tests/testUtils.py
src/ZODB/tests/testUtils.py
+5
-3
No files found.
src/ZODB/_compat.py
View file @
8ae7a5c1
...
...
@@ -14,7 +14,12 @@
try
:
# Python 2.x
from
cPickle
import
Pickler
,
Unpickler
,
dump
,
dumps
,
loads
from
cPickle
import
Pickler
from
cPickle
import
Unpickler
from
cPickle
import
dump
from
cPickle
import
dumps
from
cPickle
import
loads
from
cPickle
import
HIGHEST_PROTOCOL
IMPORT_MAPPING
=
{}
NAME_MAPPING
=
{}
_protocol
=
1
...
...
@@ -22,6 +27,7 @@ except ImportError:
# Python 3.x: can't use stdlib's pickle because
# http://bugs.python.org/issue6784
import
zodbpickle.pickle
HIGHEST_PROTOCOL
=
3
from
_compat_pickle
import
IMPORT_MAPPING
,
NAME_MAPPING
class
Pickler
(
zodbpickle
.
pickle
.
Pickler
):
...
...
src/ZODB/tests/testUtils.py
View file @
8ae7a5c1
...
...
@@ -122,9 +122,11 @@ class TestUtils(unittest.TestCase):
def test_get_pickle_metadata_w_protocol_3_class_pickle(self):
from ZODB.utils import get_pickle_metadata
from ZODB._compat import dumps
pickle = dumps(ExampleClass, protocol=3)
self.assertEqual(get_pickle_metadata(pickle),
(__name__, ExampleClass.__name__))
from ZODB._compat import HIGHEST_PROTOCOL
if HIGHEST_PROTOCOL >= 3:
pickle = dumps(ExampleClass, protocol=3)
self.assertEqual(get_pickle_metadata(pickle),
(__name__, ExampleClass.__name__))
class ExampleClass(object):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment