File tree 1 file changed +8
-12
lines changed
1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -149,20 +149,16 @@ def downloadHttpFile(httpurl):
149
149
# type: (Text) -> Text
150
150
cache_session = None
151
151
if "XDG_CACHE_HOME" in os .environ :
152
- cache_session = CacheControl (
153
- requests .Session (),
154
- cache = FileCache (
155
- os .path .join (os .environ ["XDG_CACHE_HOME" ], "cwltool" )))
152
+ directory = os .environ ["XDG_CACHE_HOME" ]
156
153
elif "HOME" in os .environ :
157
- cache_session = CacheControl (
158
- requests .Session (),
159
- cache = FileCache (
160
- os .path .join (os .environ ["HOME" ], ".cache" , "cwltool" )))
154
+ directory = os .environ ["HOME" ]
161
155
else :
162
- cache_session = CacheControl (
163
- requests .Session (),
164
- cache = FileCache (
165
- os .path .join (os .path .expanduser ('~' ), ".cache" , "cwltool" )))
156
+ directory = os .path .expanduser ('~' )
157
+
158
+ cache_session = CacheControl (
159
+ requests .Session (),
160
+ cache = FileCache (
161
+ os .path .join (directory , ".cache" , "cwltool" )))
166
162
167
163
r = cache_session .get (httpurl , stream = True )
168
164
with NamedTemporaryFile (mode = 'wb' , delete = False ) as f :
You can’t perform that action at this time.
0 commit comments