Skip to content

Commit ac53adf

Browse files
authored
fix: add missing if TYPE_CHECKING guard to generate_service_query (#1198)
1 parent 109bbe1 commit ac53adf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/zeroconf/_services/browser.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ def generate_service_query(
166166
if not qu_question and zc.question_history.suppresses(question, now, known_answers):
167167
log.debug("Asking %s was suppressed by the question history", question)
168168
continue
169-
questions_with_known_answers[question] = cast(Set[DNSPointer], known_answers)
169+
if TYPE_CHECKING:
170+
pointer_known_answers = cast(Set[DNSPointer], known_answers)
171+
else:
172+
pointer_known_answers = known_answers
173+
questions_with_known_answers[question] = pointer_known_answers
170174
if not qu_question:
171175
zc.question_history.add_question_at_time(question, now, known_answers)
172176

0 commit comments

Comments
 (0)