Skip to content

Commit afca8d8

Browse files
committed
Only create folder if valid
1 parent 99f6bc1 commit afca8d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ace/scrape.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ def process_article(self, id, journal, delay=None, mode='browser', overwrite=Fal
470470

471471
logger.info("Processing %s..." % id)
472472
journal_path = (self.store / 'html' / journal)
473-
journal_path.mkdir(parents=True, exist_ok=True)
474473
filename = journal_path / f"{id}.html"
475474

476475
if not overwrite and os.path.isfile(filename):
@@ -484,6 +483,7 @@ def process_article(self, id, journal, delay=None, mode='browser', overwrite=Fal
484483
if doc:
485484
valid = _validate_scrape(doc)
486485
if valid:
486+
journal_path.mkdir(parents=True, exist_ok=True)
487487
with filename.open('w') as f:
488488
f.write(doc)
489489
if not valid:

0 commit comments

Comments
 (0)