Skip to content

Commit 305fab9

Browse files
grischeclaude
andcommitted
fix: use a real Message for HTTPError hdrs in dependency-failure test
mypy typed hdrs as email.message.Message, so passing None failed the type check. Pass an empty Message() instead; the value is irrelevant since the tested code only stringifies the error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent cc115d6 commit 305fab9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_init.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import argparse
55
import contextlib
6+
import email.message
67
import hashlib
78
import os
89
import urllib.error
@@ -622,7 +623,7 @@ def fake_mirror(requirement, required_by=None):
622623
url="https://example.com/missing-dep/",
623624
code=404,
624625
msg="Not Found",
625-
hdrs=None,
626+
hdrs=email.message.Message(),
626627
fp=None,
627628
)
628629
return None

0 commit comments

Comments
 (0)