From fe94bb088cd05b51e223d64cf22923bff91634de Mon Sep 17 00:00:00 2001 From: John Schember Date: Mon, 26 Jan 2009 07:42:35 -0500 Subject: [PATCH] Fix Windows detection code so _main_prefix can not be None --- src/calibre/devices/usbms/device.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index dcab2d7936..495844f405 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -120,7 +120,6 @@ class Device(_Device): 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 @@ class Device(_Device): 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: