mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 18:23:37 +02:00
Fix Windows detection code so _main_prefix can not be None
This commit is contained in:
parent
381b5a0607
commit
fe94bb088c
1 changed files with 3 additions and 4 deletions
|
|
@ -120,7 +120,6 @@ def _windows_space(cls, prefix):
|
|||
|
||||
def total_space(self, end_session=True):
|
||||
msz = csz = 0
|
||||
print self._main_prefix
|
||||
if not iswindows:
|
||||
if self._main_prefix is not None:
|
||||
stats = os.statvfs(self._main_prefix)
|
||||
|
|
@ -185,11 +184,11 @@ def open_windows(self):
|
|||
if 'main' and 'card' in drives.keys():
|
||||
break
|
||||
|
||||
if not drives:
|
||||
raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__)
|
||||
|
||||
self._main_prefix = drives.get('main', None)
|
||||
self._card_prefix = drives.get('card', None)
|
||||
|
||||
if not self._main_prefix:
|
||||
raise DeviceError(_('Unable to detect the %s disk drive. Try rebooting.') % self.__class__.__name__)
|
||||
|
||||
def get_osx_mountpoints(self, raw=None):
|
||||
if raw is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue