From ea29469643f521523cadf58bfc54e4ebad05b3e9 Mon Sep 17 00:00:00 2001 From: Lance Nathan Date: Thu, 31 Oct 2013 16:00:48 -0400 Subject: [PATCH] Two small stylistic tweaks --- wordfreq/transfer.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wordfreq/transfer.py b/wordfreq/transfer.py index f5885fa..2c1e027 100644 --- a/wordfreq/transfer.py +++ b/wordfreq/transfer.py @@ -58,15 +58,11 @@ def download(url, dest_filename): Download the file at `url` to `dest_filename`. Show a progress bar while downloading. """ - base_dir = os.path.dirname(dest_filename) - if not os.path.exists(base_dir): - os.makedirs(base_dir) - + ensure_dir_exists(dest_filename) tracker = ProgressTracker(url) urlretrieve(url, dest_filename, reporthook=tracker.report_progress) tracker.finish() logger.info("Saved database to %s" % dest_filename) - return True def download_and_extract_raw_data(url=None, root_dir=None):