Skip to content

Commit 19edc54

Browse files
fix a merge issue, and load sysconfig always in non _mswindows case
1 parent b40b534 commit 19edc54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Lib/subprocess.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,11 @@ class _del_safe:
123123
import selectors
124124

125125
_os2 = (os.name == "os2")
126+
if not _mswindows:
127+
import sysconfig
126128
if _os2:
127129
import fcntl
128130
import time
129-
import sysconfig
130131

131132
# Exception classes used by this module.
132133
class SubprocessError(Exception): pass
@@ -2172,10 +2173,9 @@ def _communicate(self, input, endtime, orig_timeout):
21722173
self.stderr.close()
21732174

21742175
# All data exchanged. Translate lists into strings.
2175-
if stdout is not None:
2176-
stdout = ''.join(stdout)
2177-
if stderr is not None:
2178-
stderr = ''.join(stderr)
2176+
stdout = stdout[0] if stdout else None
2177+
stderr = stderr[0] if stderr else None
2178+
21792179
else:
21802180
if self.stdin and not self._communication_started:
21812181
# Flush stdio buffer. This might block, if the user has

0 commit comments

Comments
 (0)