File: compat.py

package info (click to toggle)
python-srsly 2.4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,624 kB
  • sloc: python: 20,571; ansic: 4,287; cpp: 51; sh: 12; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sys


if sys.version_info < (3, 8):
    try:
        import pickle5 as pickle  # noqa: F401
        from pickle5 import Pickler  # noqa: F401
    except ImportError:
        import pickle  # noqa: F401

        # Use the Python pickler for old CPython versions
        from pickle import _Pickler as Pickler  # noqa: F401
else:
    import pickle  # noqa: F401

    # Pickler will the C implementation in CPython and the Python
    # implementation in PyPy
    from pickle import Pickler  # noqa: F401