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()