Skip to content

Commit 2ede752

Browse files
authored
Merge pull request #582 from gitpython-developers/no_devnull_open
fix(cmd): checking process.DEVNUL were needlessly opening `os.devnull`
2 parents 0181a40 + 12db6bb commit 2ede752

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎git/cmd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def execute(self, command,
581581

582582
stdout_sink = (PIPE
583583
if with_stdout
584-
else getattr(subprocess, 'DEVNULL', open(os.devnull, 'wb')))
584+
else getattr(subprocess, 'DEVNULL', None) or open(os.devnull, 'wb'))
585585
log.debug("Popen(%s, cwd=%s, universal_newlines=%s, shell=%s)",
586586
command, cwd, universal_newlines, shell)
587587
try:

0 commit comments

Comments
 (0)