From c834cbcca441e4d7cebc4ca3a19a9362ba65be5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Brito?= Date: Mon, 25 Feb 2013 23:07:22 -0300 Subject: [PATCH] FileDownloader: aria2c: Delete cookies file only if it exists. --- youtube_dl/FileDownloader.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/FileDownloader.py b/youtube_dl/FileDownloader.py index abc278ce5..10d32a20f 100644 --- a/youtube_dl/FileDownloader.py +++ b/youtube_dl/FileDownloader.py @@ -657,7 +657,8 @@ class FileDownloader(object): retval = subprocess.call(basic_args) # The cookie jar is not necessary anymore - os.unlink(tmp_jar_name) + if tmp_jar_name: + os.unlink(tmp_jar_name) if retval == 0: