From 3fea0bd0c322144a6fb40dab79fa1175ea8514a7 Mon Sep 17 00:00:00 2001 From: Eric Mill Date: Sat, 25 Feb 2017 19:50:03 -0500 Subject: [PATCH] mkdir_p as necessary when walking disk --- tasks/bills.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/bills.py b/tasks/bills.py index c7ff21e4..2bdc9e61 100644 --- a/tasks/bills.py +++ b/tasks/bills.py @@ -45,7 +45,11 @@ def get_data_path(*args): args = list(args) if len(args) > 0: args.insert(1, "bills") - return os.path.join(utils.data_dir(), *args) + + data_path = os.path.join(utils.data_dir(), *args) + utils.mkdir_p(data_path) + + return data_path if not options.get('congress'): # Get a list of all congress directories on disk.