diff options
author | Michael Merickel <michael@merickel.org> | 2022-05-24 22:05:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-24 22:05:23 -0500 |
commit | 1952050446806113920152805db46edaf3dda8ba (patch) | |
tree | 3775095ed009a2caf36747488e442b306409cce9 /src/waitress/task.py | |
parent | 7c3739b27f04f01fcabe6f20e328759cbe46ea5c (diff) | |
parent | 8f5b473a8e660dbd9bdccdff4ef2dab1a14fbeb4 (diff) | |
download | waitress-1952050446806113920152805db46edaf3dda8ba.tar.gz |
Merge pull request #379 from Pylons/enhancement/pyupgrade-3.7
Run pyupgrade --py37-plus
Diffstat (limited to 'src/waitress/task.py')
-rw-r--r-- | src/waitress/task.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/waitress/task.py b/src/waitress/task.py index 3bc7f7c..574532f 100644 --- a/src/waitress/task.py +++ b/src/waitress/task.py @@ -57,7 +57,7 @@ class ThreadedTaskDispatcher: def start_new_thread(self, target, thread_no): t = threading.Thread( - target=target, name="waitress-{}".format(thread_no), args=(thread_no,) + target=target, name=f"waitress-{thread_no}", args=(thread_no,) ) t.daemon = True t.start() @@ -266,7 +266,7 @@ class Task: self.response_headers = response_headers - first_line = "HTTP/%s %s" % (self.version, self.status) + first_line = f"HTTP/{self.version} {self.status}" # NB: sorting headers needs to preserve same-named-header order # as per RFC 2616 section 4.2; thus the key=lambda x: x[0] here; # rely on stable sort to keep relative position of same-named headers @@ -400,11 +400,11 @@ class WSGITask(Task): for k, v in headers: if not k.__class__ is str: raise AssertionError( - "Header name %r is not a string in %r" % (k, (k, v)) + f"Header name {k!r} is not a string in {(k, v)!r}" ) if not v.__class__ is str: raise AssertionError( - "Header value %r is not a string in %r" % (v, (k, v)) + f"Header value {v!r} is not a string in {(k, v)!r}" ) if "\n" in v or "\r" in v: |