Skip to content

Commit

Permalink
fix: add missing if TYPE_CHECKING guard to generate_service_query (#1198
Browse files Browse the repository at this point in the history
)
  • Loading branch information
bdraco committed Jul 23, 2023
1 parent 109bbe1 commit ac53adf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/zeroconf/_services/browser.py
Expand Up @@ -166,7 +166,11 @@ def generate_service_query(
if not qu_question and zc.question_history.suppresses(question, now, known_answers):
log.debug("Asking %s was suppressed by the question history", question)
continue
questions_with_known_answers[question] = cast(Set[DNSPointer], known_answers)
if TYPE_CHECKING:
pointer_known_answers = cast(Set[DNSPointer], known_answers)
else:
pointer_known_answers = known_answers
questions_with_known_answers[question] = pointer_known_answers
if not qu_question:
zc.question_history.add_question_at_time(question, now, known_answers)

Expand Down

0 comments on commit ac53adf

Please sign in to comment.