mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 15:02: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):
|
def _isFAT32(self):
|
||||||
if not isWin:
|
if not isWin:
|
||||||
return
|
return
|
||||||
if self._dir.startswith("\\\\"):
|
|
||||||
# not sure if we can check on a network drive, so just assume no
|
|
||||||
return
|
|
||||||
import win32api, win32file
|
import win32api, win32file
|
||||||
name = win32file.GetVolumeNameForVolumeMountPoint(self._dir[:3])
|
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"):
|
if win32api.GetVolumeInformation(name)[4].lower().startswith("fat"):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue