Skip to content

Commit 43c9c8f

Browse files
committed
09_git.ipynb: Using '!mkdir -p <directory>' is not portable
Replace it with pure-Python version, using Path.mkdir() from pathlib.
1 parent e070d72 commit 43c9c8f

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

09_git.ipynb

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -151,18 +151,9 @@
151151
"cell_type": "code",
152152
"execution_count": null,
153153
"metadata": {},
154-
"outputs": [
155-
{
156-
"name": "stderr",
157-
"output_type": "stream",
158-
"text": [
159-
"A subdirectory or file repos already exists.\n",
160-
"Error occurred while processing: repos.\n"
161-
]
162-
}
163-
],
154+
"outputs": [],
164155
"source": [
165-
"!mkdir -p repos"
156+
"Path(\"repos\").mkdir(exist_ok=True)"
166157
]
167158
},
168159
{
@@ -194,17 +185,9 @@
194185
"cell_type": "code",
195186
"execution_count": null,
196187
"metadata": {},
197-
"outputs": [
198-
{
199-
"name": "stderr",
200-
"output_type": "stream",
201-
"text": [
202-
"A subdirectory or file datasets already exists.\n"
203-
]
204-
}
205-
],
188+
"outputs": [],
206189
"source": [
207-
"!mkdir -p datasets"
190+
"Path(\"datasets\").mkdir(exist_ok=True)"
208191
]
209192
},
210193
{

0 commit comments

Comments
 (0)