mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-20 08:55:41 +02:00
...
This commit is contained in:
parent
29c090e111
commit
b4cd0093b2
1 changed files with 3 additions and 2 deletions
|
|
@ -127,12 +127,13 @@ def _windows_space(cls, prefix):
|
|||
if not prefix:
|
||||
return 0, 0
|
||||
prefix = prefix[:-1]
|
||||
import win32file
|
||||
import win32file, winerror
|
||||
try:
|
||||
sectors_per_cluster, bytes_per_sector, free_clusters, total_clusters = \
|
||||
win32file.GetDiskFreeSpace(prefix)
|
||||
except Exception as err:
|
||||
if getattr(err, 'args', [None])[0] == 21: # Disk not ready
|
||||
if getattr(err, 'args', [None])[0] == winerror.ERROR_NOT_READY:
|
||||
# Disk not ready
|
||||
time.sleep(3)
|
||||
sectors_per_cluster, bytes_per_sector, free_clusters, total_clusters = \
|
||||
win32file.GetDiskFreeSpace(prefix)
|
||||
|
|
|
|||
Loading…
Reference in a new issue