From 5c3ccf5c2119c91e3dc59eab7d197fe868821b12 Mon Sep 17 00:00:00 2001 From: Dave Johansen Date: Fri, 8 Nov 2024 16:28:37 -0700 Subject: [PATCH] Apply pyupgrade 3.6 --- m3u8/model.py | 4 ++-- tests/test_model.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/m3u8/model.py b/m3u8/model.py index 9bc16071..1dc7a5e4 100644 --- a/m3u8/model.py +++ b/m3u8/model.py @@ -657,9 +657,9 @@ def dumps(self, last_segment, timespec="milliseconds", infspec="auto"): if self.uri: if self.duration is not None: if infspec == "milliseconds": - duration = "{:.3f}".format(self.duration) + duration = f"{self.duration:.3f}" elif infspec == "microseconds": - duration = "{:.6f}".format(self.duration) + duration = f"{self.duration:.6f}" else: duration = number_to_string(self.duration) output.append("#EXTINF:%s," % duration) diff --git a/tests/test_model.py b/tests/test_model.py index 8185fe38..da47a483 100755 --- a/tests/test_model.py +++ b/tests/test_model.py @@ -764,7 +764,7 @@ def test_create_sub_directories_with_relative_path(tmpdir, monkeypatch): expected_file_path = os.path.join(tmpdir, relative_path) assert os.path.exists(expected_file_path) - with open(expected_file_path, "r") as file: + with open(expected_file_path) as file: assert file.read().strip() == playlists.SIMPLE_PLAYLIST.strip()