From e0563bf2513fb040a053a8fbd279c6ded4966240 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enes=20Ayd=C4=B1n?= Date: Fri, 20 Nov 2026 17:46:09 +0300 Subject: [PATCH] [httpretty] match_https_hostname() and match_http_address() return URIMatcher | None Both classmethods were annotated as returning bool, but in httpretty 1.1.4 they iterate over `httpretty._entries` (whose keys are the URIMatcher instances created in register_uri()) and `return matcher` on a match, otherwise `return None`. Their docstrings also say they return a matcher or None, and httpretty's own callers check `if matcher is None`. Co-Authored-By: Claude Opus 5.5 --- stubs/httpretty/httpretty/core.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stubs/httpretty/httpretty/core.pyi b/stubs/httpretty/httpretty/core.pyi index d858deefecdb..6d7698f07e8f 100644 --- a/stubs/httpretty/httpretty/core.pyi +++ b/stubs/httpretty/httpretty/core.pyi @@ -132,9 +132,9 @@ class httpretty(HttpBaseClass): @classmethod def match_uriinfo(cls, info: URIInfo) -> tuple[Entry | None, list[str]]: ... @classmethod - def match_https_hostname(cls, hostname: str) -> bool: ... + def match_https_hostname(cls, hostname: str) -> URIMatcher | None: ... @classmethod - def match_http_address(cls, hostname: str, port: int) -> bool: ... + def match_http_address(cls, hostname: str, port: int) -> URIMatcher | None: ... @classmethod def record( cls,