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