summaryrefslogtreecommitdiffstats
path: root/gallery_dl/downloader/http.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2020-01-21 01:08:43 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2020-01-21 01:08:43 -0500
commit4366125d2580982abb57bc65a26fc1fb8ef2a5df (patch)
tree743a26348e360c8b7f5eb89d4f704b015e902e68 /gallery_dl/downloader/http.py
parentbc435e826dbe37969d9cbe280f58810d054932cc (diff)
New upstream version 1.12.3upstream/1.12.3
Diffstat (limited to 'gallery_dl/downloader/http.py')
-rw-r--r--gallery_dl/downloader/http.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/gallery_dl/downloader/http.py b/gallery_dl/downloader/http.py
index fab96ba..9cd2aa6 100644
--- a/gallery_dl/downloader/http.py
+++ b/gallery_dl/downloader/http.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2014-2019 Mike Fährmann
+# Copyright 2014-2020 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -8,12 +8,11 @@
"""Downloader module for http:// and https:// URLs"""
-import os
import time
import mimetypes
from requests.exceptions import RequestException, ConnectionError, Timeout
from .common import DownloaderBase
-from .. import text
+from .. import text, util
from ssl import SSLError
try:
@@ -57,10 +56,7 @@ class HttpDownloader(DownloaderBase):
finally:
# remove file from incomplete downloads
if self.downloading and not self.part:
- try:
- os.unlink(pathfmt.temppath)
- except (OSError, AttributeError):
- pass
+ util.remove_file(pathfmt.temppath)
def _download_impl(self, url, pathfmt):
response = None