Skip to content

Commit c0678ed

Browse files
authored
Merge pull request #116 from radarhere/dater
2 parents 3500334 + ccf1efb commit c0678ed

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/dater.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import annotations
88

99
import datetime as dt
10-
import os
1110
import re
1211
import subprocess
1312
from typing import TYPE_CHECKING
@@ -22,11 +21,10 @@
2221
def get_date_for(git_version: str) -> dt.datetime | None:
2322
cmd = ["git", "log", "-1", "--format=%ai", git_version]
2423
try:
25-
with open(os.devnull, "w", encoding="utf-8") as devnull:
26-
out = subprocess.check_output(
27-
cmd, stderr=devnull, text=True, encoding="utf-8"
28-
)
29-
ts = out.strip()
24+
out = subprocess.check_output(
25+
cmd, stderr=subprocess.DEVNULL, text=True, encoding="utf-8"
26+
)
27+
ts = out.strip()
3028
return dt.datetime.fromisoformat(ts)
3129
except subprocess.CalledProcessError:
3230
return None

0 commit comments

Comments
 (0)