From 2e3e8371c34bebd46bdc79fc7778d8f250d87f0c Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 15 Aug 2020 15:49:33 +0200 Subject: Convert filename to path before try to open it --- utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils.py b/utils.py index 2736206..58188b1 100644 --- a/utils.py +++ b/utils.py @@ -1,9 +1,11 @@ import sys import logging +from pathlib import Path def read_file(filename): lines = [] + filename = Path(filename) if filename.is_dir(): logging.fatal(f'{filename} is a folder instead of a file!') -- cgit v1.2.1