From 5c6e456fcccfdf9bf7c8e032ddcab18a027a2b7d Mon Sep 17 00:00:00 2001 From: didericis Date: Wed, 8 Jul 2026 19:42:27 -0400 Subject: [PATCH] fix(git-http): handle relative import when run as top-level script git_http_backend.py is run as a standalone script in the sidecar container; relative imports don't work in that context. Fall back to an absolute import so the module loads correctly either way. Co-Authored-By: Claude Sonnet 4.6 --- bot_bottle/git_http_backend.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bot_bottle/git_http_backend.py b/bot_bottle/git_http_backend.py index 1b45a38..253d45c 100644 --- a/bot_bottle/git_http_backend.py +++ b/bot_bottle/git_http_backend.py @@ -16,7 +16,12 @@ from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from pathlib import Path from urllib.parse import urlsplit -from .git_gate import GIT_GATE_TIMEOUT_SECS +try: + from .git_gate import GIT_GATE_TIMEOUT_SECS +except ImportError: + # Running as a top-level script inside the sidecar container + # (python3 /app/git_http_backend.py) rather than as part of a package. + from git_gate import GIT_GATE_TIMEOUT_SECS # type: ignore[no-redef] DEFAULT_PORT = 9420