From 1fe278b37b4031a42f8e27ee4f3251b474efcb16 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 16 Mar 2019 22:17:33 +0100 Subject: Starting some code around creating reports. --- src/ee/tools/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ee/tools/__init__.py') diff --git a/src/ee/tools/__init__.py b/src/ee/tools/__init__.py index 12916ca..b0c1051 100644 --- a/src/ee/tools/__init__.py +++ b/src/ee/tools/__init__.py @@ -1,4 +1,6 @@ import os.path +from pathlib import Path +from typing import Union from colors import color @@ -13,8 +15,8 @@ def _mkdir_and_open(path): return open(path, "w") -def mk_parents(path: str): - dirname = os.path.diŒrname(path) +def mk_parents(path: Union[str, Path]): + dirname = os.path.dirname(str(path)) if len(dirname) == 0: return -- cgit v1.2.3