Skip to content

Commit

Permalink
Apply pyupgrade 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
daveisfera committed Nov 8, 2024
1 parent c40e2f1 commit 4b6678d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions m3u8/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down

0 comments on commit 4b6678d

Please sign in to comment.