File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 22
22
from doctest import testmod
23
23
from hashlib import sha1
24
24
from multiprocessing import cpu_count , Pool
25
- from shutil import disk_usage
26
25
from tempfile import gettempdir
27
26
from time import sleep
28
27
29
28
try :
30
29
from urllib import request
31
30
from subprocess import getoutput
31
+ from shutil import disk_usage
32
32
from io import StringIO # pure-Python StringIO supports unicode.
33
33
except ImportError :
34
- request = getoutput = None
34
+ request = getoutput = disk_usage = None
35
35
from StringIO import StringIO # lint:ok
36
36
try :
37
37
import resource # windows dont have resource
@@ -1074,11 +1074,12 @@ def check_working_folder(folder_to_check):
1074
1074
# What if destination folder is not Writable by the user.
1075
1075
elif not os .access (folder_to_check , os .W_OK ):
1076
1076
log .critical ("Folder {} Not Writable !." .format (folder_to_check ))
1077
- hdd = int (disk_usage (folder_to_check ).free / 1024 / 1024 / 1024 )
1078
- if hdd : # > 1 Gb
1079
- log .info ("Total Free Space: ~{} GigaBytes." .format (hdd ))
1080
- else : # < 1 Gb
1081
- log .critical ("Total Free Space is < 1 GigaByte; Epic Fail !." )
1077
+ if disk_usage :
1078
+ hdd = int (disk_usage (folder_to_check ).free / 1024 / 1024 / 1024 )
1079
+ if hdd : # > 1 Gb
1080
+ log .info ("Total Free Space: ~{} GigaBytes." .format (hdd ))
1081
+ else : # < 1 Gb
1082
+ log .critical ("Total Free Space is < 1 GigaByte; Epic Fail !." )
1082
1083
1083
1084
1084
1085
def make_arguments_parser ():
You can’t perform that action at this time.
0 commit comments