Skip to content

Commit 7732918

Browse files
committed
chore: improve type hinting
1 parent 4658b9a commit 7732918

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

dnsdiag/shared.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import random
2828
import string
2929
import sys
30+
from typing import Optional
3031

3132
__version__ = '2.9.3'
3233

@@ -46,7 +47,7 @@ def err(s: str) -> None:
4647
print(s, file=sys.stderr, flush=True)
4748

4849

49-
def set_protocol_exclusive(new_proto: int, current_option: str, proto_option_set: str | None) -> tuple[int, str]:
50+
def set_protocol_exclusive(new_proto: int, current_option: str, proto_option_set: Optional[str]) -> tuple[int, str]:
5051
"""
5152
Set protocol ensuring mutual exclusivity.
5253

dnseval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def main() -> None:
221221
verbose = False
222222
color_mode = False
223223
warmup = True
224-
proto_option_set: str | None = None
224+
proto_option_set: Optional[str] = None
225225
qname = 'wikipedia.org'
226226

227227
try:

dnsping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def main() -> None:
188188
af = None
189189
af_ipv4_set = False
190190
af_ipv6_set = False
191-
proto_option_set: str | None = None
191+
proto_option_set: Optional[str] = None
192192
qname = 'wikipedia.org'
193193

194194
try:

dnstraceroute.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def main() -> None:
198198
af = None # auto-detect from server address
199199
af_ipv4_set = False
200200
af_ipv6_set = False
201-
proto_option_set: str | None = None
201+
proto_option_set: Optional[str] = None
202202

203203
args = None
204204
try:

0 commit comments

Comments
 (0)