Skip to content

Commit

Permalink
use os.path.isdir instead of catching error
Browse files Browse the repository at this point in the history
  • Loading branch information
Christovis committed May 4, 2021
1 parent f9c01eb commit aed908f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bigbang/listserv.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,10 +987,8 @@ def from_mailing_lists(
if len(mlist) != 0:
if instant_save:
dir_out = CONFIG.mail_path + name
try:
if os.path.isdir(dir_out) is False:
os.mkdir(dir_out)
except FileExistsError:
pass # temporary directory already exists, that's cool
mlist.to_mbox(dir_out=dir_out)
else:
logger.info(f"Recorded the list {mlist.name}.")
Expand Down Expand Up @@ -1087,10 +1085,8 @@ def get_lists_from_url(
if len(mlist) != 0:
if instant_save:
dir_out = CONFIG.mail_path + name
try:
if os.path.isdir(dir_out) is False:
os.mkdir(dir_out)
except FileExistsError:
pass # temporary directory already exists, that's cool
mlist.to_mbox(dir_out=CONFIG.mail_path)
archive.append(mlist.name)
else:
Expand Down

0 comments on commit aed908f

Please sign in to comment.