diff --git a/borg/archive.py b/borg/archive.py index c50759bc6..27cd9d0aa 100644 --- a/borg/archive.py +++ b/borg/archive.py @@ -13,8 +13,8 @@ import time from io import BytesIO from . import xattr from .helpers import parse_timestamp, Error, uid2user, user2uid, gid2group, group2gid, \ - Manifest, Statistics, decode_dict, st_mtime_ns, make_path_safe, StableDict, int_to_bigint, bigint_to_int, detect_cython -if detect_cython(): + Manifest, Statistics, decode_dict, st_mtime_ns, make_path_safe, StableDict, int_to_bigint, bigint_to_int, have_cython +if have_cython(): from .platform import acl_get, acl_set from .chunker import Chunker from .hashindex import ChunkIndex diff --git a/borg/archiver.py b/borg/archiver.py index dca7e4af7..b30a47b88 100644 --- a/borg/archiver.py +++ b/borg/archiver.py @@ -19,8 +19,8 @@ from .helpers import Error, location_validator, format_time, format_file_size, \ format_file_mode, ExcludePattern, IncludePattern, exclude_path, adjust_patterns, to_localtime, timestamp, \ get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \ Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \ - is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, detect_cython -if detect_cython(): + is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, have_cython +if have_cython(): from .compress import Compressor, COMPR_BUFFER from .upgrader import AtticRepositoryUpgrader from .repository import Repository diff --git a/borg/helpers.py b/borg/helpers.py index bfbc45a21..10ee0441a 100644 --- a/borg/helpers.py +++ b/borg/helpers.py @@ -18,7 +18,7 @@ from operator import attrgetter import msgpack -def detect_cython(): +def have_cython(): """allow for a way to disable Cython includes this is used during usage docs build, in setup.py. It is to avoid @@ -33,7 +33,7 @@ def detect_cython(): """ return not os.environ.get('BORG_CYTHON_DISABLE') -if detect_cython(): +if have_cython(): from . import hashindex from . import chunker from . import crypto diff --git a/borg/key.py b/borg/key.py index 2d0ffc86e..81f9185c8 100644 --- a/borg/key.py +++ b/borg/key.py @@ -7,8 +7,8 @@ import textwrap import hmac from hashlib import sha256 -from .helpers import IntegrityError, get_keys_dir, Error, detect_cython -if detect_cython(): +from .helpers import IntegrityError, get_keys_dir, Error, have_cython +if have_cython(): from .crypto import pbkdf2_sha256, get_random_bytes, AES, bytes_to_long, long_to_bytes, bytes_to_int, num_aes_blocks from .compress import Compressor, COMPR_BUFFER diff --git a/borg/repository.py b/borg/repository.py index 762a40302..c762d09dc 100644 --- a/borg/repository.py +++ b/borg/repository.py @@ -8,8 +8,8 @@ import struct import sys from zlib import crc32 -from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, detect_cython -if detect_cython(): +from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, have_cython +if have_cython(): from .hashindex import NSIndex from .locking import UpgradableLock from .lrucache import LRUCache