From 348a784550b8d718e53b28f5a3d62ec2545bd279 Mon Sep 17 00:00:00 2001 From: wangyu Date: Tue, 18 Jun 2024 12:48:28 +0800 Subject: [PATCH] Fix the problem of not running on Windows --- mtkclient/Library/Filesystem/mtkdafs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mtkclient/Library/Filesystem/mtkdafs.py b/mtkclient/Library/Filesystem/mtkdafs.py index 425757d8..557c8bac 100644 --- a/mtkclient/Library/Filesystem/mtkdafs.py +++ b/mtkclient/Library/Filesystem/mtkdafs.py @@ -1,7 +1,3 @@ -try: - from fuse import Operations, LoggingMixIn -except ImportError: - raise ImportError('fuse library not installed') from stat import S_IFDIR, S_IFREG from tempfile import NamedTemporaryFile from time import time @@ -12,7 +8,10 @@ os.environ.setdefault('FUSE_LIBRARY_PATH', os.path.join(os.path.dirname(__file__), r"bin\winfsp-%s.dll" % ("x64" if sys.maxsize > 0xffffffff else "x86"))) - +try: + from fuse import Operations, LoggingMixIn +except ImportError: + raise ImportError('fuse library not installed') class MtkDaFS(LoggingMixIn, Operations): def __init__(self, da_handler, rw=False):