Skip to content

Commit 0cd904a

Browse files
committed
Import only unlink and environ from os
To avoid using os.path by memory
1 parent e014cc9 commit 0cd904a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

git_evtag_py.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import argparse
99
import hashlib
1010
import logging
11-
import os
1211
import re
1312
import subprocess
1413
import tempfile
1514
import types
15+
from os import environ, unlink
1616
from pathlib import Path
1717
from typing import IO, Self
1818

@@ -125,14 +125,14 @@ def sign_tree_checksum(
125125
elif tag_msg_file:
126126
message = Path(tag_msg_file).read_text()
127127
else:
128-
editor = os.environ.get("EDITOR", "vi")
128+
editor = environ.get("EDITOR", "vi")
129129
with tempfile.NamedTemporaryFile(mode="w+", delete=False, suffix=".tmp") as tmp:
130130
tmp.write("")
131131
tmp.flush()
132132
subprocess.run([editor, tmp.name], check=True)
133133
tmp.seek(0)
134134
message = tmp.read()
135-
os.unlink(tmp.name)
135+
unlink(tmp.name)
136136

137137
pattern = (
138138
r"\n?Git-EVTag-v0-SHA512: .*\n?"

0 commit comments

Comments
 (0)