Skip to content

Commit

Permalink
most complete compatibility by using the __all__ from the imported mo…
Browse files Browse the repository at this point in the history
…dules
  • Loading branch information
ctismer committed Jul 3, 2013
1 parent d57a873 commit 3af5606
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
30 changes: 3 additions & 27 deletions src/zodbpickle/pickle.py
@@ -1,31 +1,7 @@
import sys

__all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
"Unpickler", "dump", "dumps", "load", "loads"]

if sys.version_info[0] >= 3:
from .pickle_3 import (
PickleError,
PicklingError,
UnpicklingError,
Pickler,
Unpickler,
dump,
dumps,
load,
loads,
# needed by pickletester
bytes_types
)
from .pickle_3 import *
else:
from .pickle_2 import (
PickleError,
PicklingError,
UnpicklingError,
Pickler,
Unpickler,
dump,
dumps,
load,
loads,
)
from .pickle_2 import *
del sys
1 change: 1 addition & 0 deletions src/zodbpickle/pickle_3.py
Expand Up @@ -39,6 +39,7 @@

# Shortcut for use in isinstance testing
bytes_types = (bytes, bytearray)
__all__.append('bytes_types')

# These are purely informational; no code uses these.
format_version = "3.0" # File format version we write
Expand Down

0 comments on commit 3af5606

Please sign in to comment.