Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 23c5b6f

Browse filesBrowse files
committed
Added creation of downloads dir if it doesn't exist for chapter17 flags.
1 parent 3d74f0e commit 23c5b6f
Copy full SHA for 23c5b6f

File tree

Expand file treeCollapse file tree

2 files changed

+4
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-0
lines changed

‎17-futures/countries/flags.py

Copy file name to clipboardExpand all lines: 17-futures/countries/flags.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525

2626

2727
def save_flag(img, filename): # <5>
28+
if not os.path.exists(DEST_DIR):
29+
os.makedirs(DEST_DIR)
2830
path = os.path.join(DEST_DIR, filename)
2931
with open(path, 'wb') as fp:
3032
fp.write(img)

‎17-futures/countries/flags2_common.py

Copy file name to clipboardExpand all lines: 17-futures/countries/flags2_common.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434

3535
def save_flag(img, filename):
36+
if not os.path.exists(DEST_DIR):
37+
os.makedirs(DEST_DIR)
3638
path = os.path.join(DEST_DIR, filename)
3739
with open(path, 'wb') as fp:
3840
fp.write(img)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.