Skip to content
Permalink
Browse files

In Python 3, we can use os.makedirs(..., exist_ok=True)

  • Loading branch information...
ageron committed Aug 27, 2019
1 parent e8f86ce commit 3c896e115ccfe0f7664c3e4e125e34758c5dd48a
Showing with 1 addition and 2 deletions.
  1. +1 −2 02_end_to_end_machine_learning_project.ipynb
@@ -95,8 +95,7 @@
"HOUSING_URL = DOWNLOAD_ROOT + \"datasets/housing/housing.tgz\"\n",
"\n",
"def fetch_housing_data(housing_url=HOUSING_URL, housing_path=HOUSING_PATH):\n",
" if not os.path.isdir(housing_path):\n",
" os.makedirs(housing_path)\n",
" os.makedirs(housing_path, exist_ok=True)\n",
" tgz_path = os.path.join(housing_path, \"housing.tgz\")\n",
" urllib.request.urlretrieve(housing_url, tgz_path)\n",
" housing_tgz = tarfile.open(tgz_path)\n",

0 comments on commit 3c896e1

Please sign in to comment.
You can’t perform that action at this time.