From 21723d3dc64cdfd14119315cd5e9e0f55b175cc8 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Thu, 23 Nov 2023 12:31:24 -0800 Subject: [PATCH 1/1] fetch: Try closing connections more aggressively --- paperdoorknob.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paperdoorknob.py b/paperdoorknob.py index cd93e4e..70f3af5 100644 --- a/paperdoorknob.py +++ b/paperdoorknob.py @@ -20,8 +20,8 @@ def command_line_parser() -> ArgumentParser: def fetch(url: str, timeout: int) -> None: - r = requests.get(url, timeout=timeout) - r.raise_for_status() + with requests.get(url, timeout=timeout) as r: + r.raise_for_status() def main() -> None: -- 2.44.1