Skip to content

Commit

Permalink
fix: elf_diff not creating parent directories
Browse files Browse the repository at this point in the history
  • Loading branch information
noseglasses committed Mar 16, 2024
1 parent f701f16 commit 4294e80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/elf_diff/plugins/export/html/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from elf_diff.pair_report_document import ValueTreeNode
from elf_diff.settings import Settings
import os
import pathlib
from shutil import copyfile
import difflib
import sys
Expand Down Expand Up @@ -728,7 +729,7 @@ def exportMultiPage(self) -> None:

for dir_ in dirs:
if not os.path.exists(dir_):
os.mkdir(dir_)
pathlib.Path(dir_).mkdir(parents=True, exist_ok=True)

plugin_module_path: str = self.getModulePath()

Expand Down
3 changes: 2 additions & 1 deletion tests/elf_diff_test/test_in_subdirs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import unittest
import re
import os
import pathlib
import sys
from typing import Optional, Union, Type # pylint: disable=unused-import # noqa: F401

Expand All @@ -44,7 +45,7 @@ def _setUpScoped(cls, scope, directory):
"""Generate and change to a directory that represents either the test or the test class scope"""
scope.OLD_PWD = os.getcwd()
if not os.path.exists(directory):
os.mkdir(directory)
pathlib.Path(directory).mkdir(parents=True, exist_ok=True)
os.chdir(directory)

@classmethod
Expand Down

0 comments on commit 4294e80

Please sign in to comment.