From b422550e743dbd8f202c226b2d686405e0bfcb9f Mon Sep 17 00:00:00 2001 From: Rijnder Wever Date: Thu, 12 Dec 2024 13:26:56 +0100 Subject: [PATCH] fix: allow executing mdto.py as a script Relative imports are a bit of a mess --- mdto/mdto.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mdto/mdto.py b/mdto/mdto.py index db3a901..f7f8e46 100755 --- a/mdto/mdto.py +++ b/mdto/mdto.py @@ -9,7 +9,10 @@ from pathlib import Path from typing import Any, List, TextIO -from . import helpers +try: + from . import helpers # Package context +except ImportError: + import helpers # Direct execution import lxml.etree as ET import validators