summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2023-03-30 06:29:20 -0700
committerBob Halley <halley@dnspython.org>2023-03-30 06:29:20 -0700
commit301346cf567cfde62e8b9823a19271a88aebf342 (patch)
tree2238d88cb3983ef4cba1bd5a907ba6d53235bf69
parent842f0bbd85e39dae7eb396c788ad0ff77a1cf493 (diff)
downloaddnspython-301346cf567cfde62e8b9823a19271a88aebf342.tar.gz
run black
-rw-r--r--Makefile3
-rw-r--r--dns/quic/_common.py2
-rw-r--r--dns/rdtypes/ANY/LOC.py2
-rw-r--r--dns/rdtypes/IN/APL.py1
-rw-r--r--dns/rdtypes/util.py10
-rwxr-xr-xexamples/edns.py2
-rw-r--r--examples/edns_resolver.py2
-rwxr-xr-xexamples/reverse.py2
8 files changed, 13 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 66b4cff..e0f7ccd 100644
--- a/Makefile
+++ b/Makefile
@@ -80,3 +80,6 @@ pokit:
findjunk:
find dns -type f | egrep -v '.*\.py' | egrep -v 'py\.typed'
+
+poblack:
+ poetry run black dns examples tests
diff --git a/dns/quic/_common.py b/dns/quic/_common.py
index 625fab7..442b382 100644
--- a/dns/quic/_common.py
+++ b/dns/quic/_common.py
@@ -151,7 +151,7 @@ class BaseQuicManager:
conf = aioquic.quic.configuration.QuicConfiguration(
alpn_protocols=["doq", "doq-i03"],
verify_mode=verify_mode,
- server_name=server_name
+ server_name=server_name,
)
if verify_path is not None:
conf.load_verify_locations(verify_path)
diff --git a/dns/rdtypes/ANY/LOC.py b/dns/rdtypes/ANY/LOC.py
index 52c9753..028375d 100644
--- a/dns/rdtypes/ANY/LOC.py
+++ b/dns/rdtypes/ANY/LOC.py
@@ -40,7 +40,7 @@ def _exponent_of(what, desc):
if what == 0:
return 0
exp = None
- for (i, pow) in enumerate(_pows):
+ for i, pow in enumerate(_pows):
if what < pow:
exp = i - 1
break
diff --git a/dns/rdtypes/IN/APL.py b/dns/rdtypes/IN/APL.py
index 05e1689..f1bb01d 100644
--- a/dns/rdtypes/IN/APL.py
+++ b/dns/rdtypes/IN/APL.py
@@ -124,7 +124,6 @@ class APL(dns.rdata.Rdata):
@classmethod
def from_wire_parser(cls, rdclass, rdtype, parser, origin=None):
-
items = []
while parser.remaining() > 0:
header = parser.get_struct("!HBB")
diff --git a/dns/rdtypes/util.py b/dns/rdtypes/util.py
index 46c98cf..54908fd 100644
--- a/dns/rdtypes/util.py
+++ b/dns/rdtypes/util.py
@@ -120,7 +120,7 @@ class Bitmap:
def __init__(self, windows=None):
last_window = -1
self.windows = windows
- for (window, bitmap) in self.windows:
+ for window, bitmap in self.windows:
if not isinstance(window, int):
raise ValueError(f"bad {self.type_name} window type")
if window <= last_window:
@@ -135,9 +135,9 @@ class Bitmap:
def to_text(self) -> str:
text = ""
- for (window, bitmap) in self.windows:
+ for window, bitmap in self.windows:
bits = []
- for (i, byte) in enumerate(bitmap):
+ for i, byte in enumerate(bitmap):
for j in range(0, 8):
if byte & (0x80 >> j):
rdtype = window * 256 + i * 8 + j
@@ -183,7 +183,7 @@ class Bitmap:
return cls(windows)
def to_wire(self, file: Any) -> None:
- for (window, bitmap) in self.windows:
+ for window, bitmap in self.windows:
file.write(struct.pack("!BB", window, len(bitmap)))
file.write(bitmap)
@@ -231,7 +231,7 @@ def weighted_processing_order(iterable):
total = sum(rdata._processing_weight() or _no_weight for rdata in rdatas)
while len(rdatas) > 1:
r = random.uniform(0, total)
- for (n, rdata) in enumerate(rdatas):
+ for n, rdata in enumerate(rdatas):
weight = rdata._processing_weight() or _no_weight
if weight > r:
break
diff --git a/examples/edns.py b/examples/edns.py
index 0566bfb..9738a0d 100755
--- a/examples/edns.py
+++ b/examples/edns.py
@@ -60,7 +60,7 @@ q_list.append(
(l, dns.message.make_query(n, t, options=[dns.edns.ECSOption("192.168.0.0", 20)]))
)
-for (addr, q) in q_list:
+for addr, q in q_list:
r = dns.query.udp(q, addr)
if not r.options:
print("No EDNS options returned")
diff --git a/examples/edns_resolver.py b/examples/edns_resolver.py
index 6edf4a9..a43ad25 100644
--- a/examples/edns_resolver.py
+++ b/examples/edns_resolver.py
@@ -53,7 +53,7 @@ o_list.append((l, dict(options=[dns.edns.ECSOption(external_ip, 24)])))
aresolver = dns.resolver.Resolver()
-for (addr, edns_kwargs) in o_list:
+for addr, edns_kwargs in o_list:
if edns_kwargs:
aresolver.use_edns(**edns_kwargs)
aresolver.nameservers = ["8.8.8.8"]
diff --git a/examples/reverse.py b/examples/reverse.py
index 5829c68..012617c 100755
--- a/examples/reverse.py
+++ b/examples/reverse.py
@@ -26,7 +26,7 @@ reverse_map = {} # type: Dict[str, List[str]]
for filename in sys.argv[1:]:
zone = dns.zone.from_file(filename, os.path.basename(filename), relativize=False)
- for (name, ttl, rdata) in zone.iterate_rdatas("A"):
+ for name, ttl, rdata in zone.iterate_rdatas("A"):
print(type(rdata))
try:
reverse_map[rdata.address].append(name.to_text())