mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 23:12:21 -04:00
catch errors trying to determine fs type
This commit is contained in:
parent
077d6b8187
commit
f2d538d546
1 changed files with 5 additions and 4 deletions
|
@ -72,11 +72,12 @@ class MediaManager(object):
|
|||
def _isFAT32(self):
|
||||
if not isWin:
|
||||
return
|
||||
if self._dir.startswith("\\\\"):
|
||||
# not sure if we can check on a network drive, so just assume no
|
||||
return
|
||||
import win32api, win32file
|
||||
try:
|
||||
name = win32file.GetVolumeNameForVolumeMountPoint(self._dir[:3])
|
||||
except:
|
||||
# mapped & unmapped network drive; pray that it's not vfat
|
||||
return
|
||||
if win32api.GetVolumeInformation(name)[4].lower().startswith("fat"):
|
||||
return True
|
||||
|
||||
|
|
Loading…
Reference in a new issue