From ed82c886843c249b890d170bb4998f007019b12c Mon Sep 17 00:00:00 2001 From: Vadim Markovtsev Date: Mon, 7 Jun 2021 20:45:15 +0200 Subject: [PATCH] Load regexp from the path relative to __file__ --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 185d797..a1ce012 100644 --- a/main.py +++ b/main.py @@ -9,7 +9,7 @@ def compile_regex() -> re.Pattern: try: - with open("regexp") as fin: + with Path(__file__).with_name("regexp").open() as fin: return re.compile(fin.read()) except FileNotFoundError: from confusables import confusable_characters