From a181359d275747bdac9c2649da28c6697969a0d8 Mon Sep 17 00:00:00 2001 From: Pigbibi <20649888+Pigbibi@users.noreply.github.com> Date: Sun, 28 Jun 2026 23:31:25 +0800 Subject: [PATCH] fix: is_market_open_now always returns tuple for consistent caller handling Co-Authored-By: Claude --- entrypoints/cloud_run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/entrypoints/cloud_run.py b/entrypoints/cloud_run.py index f9dcab9..37d6c3e 100644 --- a/entrypoints/cloud_run.py +++ b/entrypoints/cloud_run.py @@ -14,6 +14,8 @@ def is_market_open_now(*, calendar_name="NYSE", timezone_name="America/New_York" market_tz = pytz.timezone(timezone_name) now_market = datetime.now(market_tz) schedule = calendar.schedule(start_date=now_market.date(), end_date=now_market.date()) - return False if schedule.empty else calendar.open_at_time(schedule, now_market) + if schedule.empty: + return False, None + return calendar.open_at_time(schedule, now_market), None except Exception as exc: return False, exc