From 4ba2d83dff15bbe0a4c42041848117023e949379 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 17 Oct 2023 18:52:55 -0700 Subject: [PATCH] youtube: Fix for HTTPError stub change. https://github.com/python/typeshed/pull/10875 Signed-off-by: Anders Kaseorg --- zulip_bots/zulip_bots/bots/youtube/youtube.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zulip_bots/zulip_bots/bots/youtube/youtube.py b/zulip_bots/zulip_bots/bots/youtube/youtube.py index 872bb012f..d9fae791f 100644 --- a/zulip_bots/zulip_bots/bots/youtube/youtube.py +++ b/zulip_bots/zulip_bots/bots/youtube/youtube.py @@ -34,6 +34,7 @@ def initialize(self, bot_handler: BotHandler) -> None: try: search_youtube("test", self.config_info["key"], self.config_info["video_region"]) except HTTPError as e: + assert e.response is not None if e.response.json()["error"]["errors"][0]["reason"] == "keyInvalid": bot_handler.quit( "Invalid key." "Follow the instructions in doc.md for setting API key."