From b77c7d509a4d87ca597e3dd98a53e541db0630d8 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 15 Sep 2023 23:41:01 +0300 Subject: [PATCH] Upgrade Python syntax with pyupgrade --py38-plus --- cachecontrol/caches/file_cache.py | 2 +- docs/conf.py | 2 -- examples/benchmark.py | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cachecontrol/caches/file_cache.py b/cachecontrol/caches/file_cache.py index 76af2cbb..0f941713 100644 --- a/cachecontrol/caches/file_cache.py +++ b/cachecontrol/caches/file_cache.py @@ -64,7 +64,7 @@ class _FileCacheMixin: def __init__( self, - directory: Union[str, Path], + directory: str | Path, forever: bool = False, filemode: int = 0o0600, dirmode: int = 0o0700, diff --git a/docs/conf.py b/docs/conf.py index 170b7920..a8f7edd9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - # SPDX-FileCopyrightText: 2015 Eric Larson # # SPDX-License-Identifier: Apache-2.0 diff --git a/examples/benchmark.py b/examples/benchmark.py index b036f788..680d3b2d 100644 --- a/examples/benchmark.py +++ b/examples/benchmark.py @@ -13,10 +13,10 @@ HOST = "localhost" PORT = 8050 -URL = "http://{}:{}/".format(HOST, PORT) +URL = f"http://{HOST}:{PORT}/" -class Server(object): +class Server: def __call__(self, env, sr): body = "Hello World!"