From b9bb360435da1e6a91a74d0fc7aed40f6a7e8214 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 28 Feb 2026 23:02:01 +0000 Subject: [PATCH] fix: support relative and absolute imports in __main__.py for PyInstaller exe When bundled as a standalone executable, __main__.py runs without a parent package context, causing 'attempted relative import with no known parent package'. Added a try/except fallback to use the absolute import path in that case. https://claude.ai/code/session_01MjYxpbJ9Cy15YhghH1KNow --- src/venting/__main__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/venting/__main__.py b/src/venting/__main__.py index 9ae637f..dfe23d6 100644 --- a/src/venting/__main__.py +++ b/src/venting/__main__.py @@ -1,4 +1,7 @@ -from .cli import main +try: + from .cli import main +except ImportError: + from venting.cli import main if __name__ == "__main__": main()