fix false positive lint issue

This commit is contained in:
Manuel Barkhau 2021-05-13 18:17:50 +00:00
parent 26e3232170
commit 2243e025b7

View file

@ -151,7 +151,11 @@ class VCSAPI:
self('commit', env=env, message=message) self('commit', env=env, message=message)
else: else:
message_data = message.encode("utf-8") message_data = message.encode("utf-8")
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
# The tmp_file must exist for the duration of the commit command,
# but also must be flushed and closed before the command runs.
# pylint:disable=consider-using-with
tmp_file = tempfile.NamedTemporaryFile("wb", delete=False)
try: try:
assert " " not in tmp_file.name assert " " not in tmp_file.name