Browse Source

fix logical inversion in the semantics of detect_cython()

Antoine Beaupré 9 years ago
parent
commit
f98998f042
5 changed files with 6 additions and 6 deletions
  1. 1 1
      borg/archive.py
  2. 1 1
      borg/archiver.py
  3. 2 2
      borg/helpers.py
  4. 1 1
      borg/key.py
  5. 1 1
      borg/repository.py

+ 1 - 1
borg/archive.py

@@ -14,7 +14,7 @@ from io import BytesIO
 from . import xattr
 from . import xattr
 from .helpers import parse_timestamp, Error, uid2user, user2uid, gid2group, group2gid, \
 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
     Manifest, Statistics, decode_dict, st_mtime_ns, make_path_safe, StableDict, int_to_bigint, bigint_to_int, detect_cython
-if not detect_cython():
+if detect_cython():
     from .platform import acl_get, acl_set
     from .platform import acl_get, acl_set
     from .chunker import Chunker
     from .chunker import Chunker
     from .hashindex import ChunkIndex
     from .hashindex import ChunkIndex

+ 1 - 1
borg/archiver.py

@@ -20,7 +20,7 @@ from .helpers import Error, location_validator, format_time, format_file_size, \
     get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \
     get_cache_dir, get_keys_dir, format_timedelta, prune_within, prune_split, \
     Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \
     Manifest, remove_surrogates, update_excludes, format_archive, check_extension_modules, Statistics, \
     is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, detect_cython
     is_cachedir, bigint_to_int, ChunkerParams, CompressionSpec, detect_cython
-if not detect_cython():
+if detect_cython():
     from .compress import Compressor, COMPR_BUFFER
     from .compress import Compressor, COMPR_BUFFER
     from .upgrader import AtticRepositoryUpgrader
     from .upgrader import AtticRepositoryUpgrader
     from .repository import Repository
     from .repository import Repository

+ 2 - 2
borg/helpers.py

@@ -29,9 +29,9 @@ def detect_cython():
     which, when set (to anything) will disable includes of Cython
     which, when set (to anything) will disable includes of Cython
     libraries in key places to enable usage docs to be built.
     libraries in key places to enable usage docs to be built.
     """
     """
-    return os.environ.get('BORG_CYTHON_DISABLE')
+    return not os.environ.get('BORG_CYTHON_DISABLE')
 
 
-if not detect_cython():
+if detect_cython():
     from . import hashindex
     from . import hashindex
     from . import chunker
     from . import chunker
     from . import crypto
     from . import crypto

+ 1 - 1
borg/key.py

@@ -8,7 +8,7 @@ import hmac
 from hashlib import sha256
 from hashlib import sha256
 
 
 from .helpers import IntegrityError, get_keys_dir, Error, detect_cython
 from .helpers import IntegrityError, get_keys_dir, Error, detect_cython
-if not detect_cython():
+if detect_cython():
     from .crypto import pbkdf2_sha256, get_random_bytes, AES, bytes_to_long, long_to_bytes, bytes_to_int, num_aes_blocks
     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
     from .compress import Compressor, COMPR_BUFFER
 
 

+ 1 - 1
borg/repository.py

@@ -9,7 +9,7 @@ import sys
 from zlib import crc32
 from zlib import crc32
 
 
 from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, detect_cython
 from .helpers import Error, IntegrityError, read_msgpack, write_msgpack, unhexlify, detect_cython
-if not detect_cython():
+if detect_cython():
     from .hashindex import NSIndex
     from .hashindex import NSIndex
 from .locking import UpgradableLock
 from .locking import UpgradableLock
 from .lrucache import LRUCache
 from .lrucache import LRUCache