2
0
Эх сурвалжийг харах

try to fix RTD build *again* *again*

Antoine Beaupré 9 жил өмнө
parent
commit
a869ab0702
3 өөрчлөгдсөн 12 нэмэгдсэн , 6 устгасан
  1. 4 2
      borg/cache.py
  2. 4 2
      borg/fuse.py
  3. 4 2
      borg/remote.py

+ 4 - 2
borg/cache.py

@@ -1,7 +1,6 @@
 import configparser
 from .remote import cache_if_remote
 import errno
-import msgpack
 import os
 import stat
 import sys
@@ -12,10 +11,13 @@ import tempfile
 
 from .key import PlaintextKey
 from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify, int_to_bigint, \
-    bigint_to_int
+    bigint_to_int, have_cython
 from .locking import UpgradableLock
 from .hashindex import ChunkIndex
 
+if have_cython:
+    import msgpack
+
 
 class Cache:
     """Client Side cache

+ 4 - 2
borg/fuse.py

@@ -2,15 +2,17 @@ from collections import defaultdict
 import errno
 import io
 import llfuse
-import msgpack
 import os
 import stat
 import tempfile
 import time
 from .archive import Archive
-from .helpers import daemonize
+from .helpers import daemonize, have_cython
 from .remote import cache_if_remote
 
+if have_cython:
+    import msgpack
+
 # Does this version of llfuse support ns precision?
 have_fuse_mtime_ns = hasattr(llfuse.EntryAttributes, 'st_mtime_ns')
 

+ 4 - 2
borg/remote.py

@@ -1,6 +1,5 @@
 import errno
 import fcntl
-import msgpack
 import os
 import select
 import shlex
@@ -11,9 +10,12 @@ import traceback
 
 from . import __version__
 
-from .helpers import Error, IntegrityError
+from .helpers import Error, IntegrityError, have_cython
 from .repository import Repository
 
+if have_cython:
+    import msgpack
+
 BUFSIZE = 10 * 1024 * 1024