comparison cutils/util/constants.py @ 164:a813094ae4f5

Move PY2 from cutils.util.constants into cutils.util
author Franz Glasner <fzglas.hg@dom66.de>
date Thu, 09 Jan 2025 13:48:57 +0100
parents dfe7bb0579e2
children 0f4febf646f5
comparison
equal deleted inserted replaced
163:fa7dd54e9715 164:a813094ae4f5
5 # :- 5 # :-
6 r"""Common constants and compatibility definitions. 6 r"""Common constants and compatibility definitions.
7 7
8 """ 8 """
9 9
10 __all__ = ["PY2", 10 __all__ = ["PATH_TYPES",
11 "PATH_TYPES",
12 "READ_CHUNK_SIZE", 11 "READ_CHUNK_SIZE",
13 "MAX_AUTO_MAP_SIZE", 12 "MAX_AUTO_MAP_SIZE",
14 "MAP_WINDOW_SIZE" 13 "MAP_WINDOW_SIZE"
15 ] 14 ]
16 15
17 16
18 import sys
19 try: 17 try:
20 import pathlib 18 import pathlib
21 except ImportError: 19 except ImportError:
22 pathlib = None 20 pathlib = None
23 21
22 from . import PY2
24 23
25 PY2 = sys.version_info[0] < 3
26 24
27 if PY2: 25 if PY2:
28 PATH_TYPES = (unicode, str) # noqa: F821 (undefined name 'unicode') 26 PATH_TYPES = (unicode, str) # noqa: F821 (undefined name 'unicode')
29 else: 27 else:
30 if pathlib: 28 if pathlib: