catch errors trying to determine fs type

This commit is contained in:
Damien Elmes 2013-06-14 13:15:05 +09:00
parent 077d6b8187
commit f2d538d546

View file

@ -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
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"):
return True