Fixbug where we suppress the exception if download fails while wait_for_status.
This exception will happen if the download RPC fails making _staging_dir = None
after Cleanup is invoked and GetStatusOfBackgroundDownloads is being called.
Bug was introduced in: Ic73a9ca0fbfd66c8ee79b8848dd019c0fca5d7d9
BUG=None
TEST=Pylint + unittest
Change-Id: I8fc2be04e21b673267ff4d0b6249e62080ce3e1b
Reviewed-on: https://gerrit.chromium.org/gerrit/34379
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Miller <milleral@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
diff --git a/downloader.py b/downloader.py
index cb705cc..523c0d5 100755
--- a/downloader.py
+++ b/downloader.py
@@ -204,7 +204,7 @@
self._status_queue.put(status)
# If someone is curious about the status of a build, then we should
# probably keep it around for a bit longer.
- if os.path.exists(self._staging_dir):
+ if self._staging_dir and os.path.exists(self._staging_dir):
Downloader._TouchTimestampForStaged(self._staging_dir)
# It's possible we received an exception, if so, re-raise it here.
if isinstance(status, Exception):