Skip to content

Commit 848d0c8

Browse files
committed
Don't use assert in production code.
1 parent fcd44e3 commit 848d0c8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tox/session.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ def popen(self, args, cwd=None, env=None, redirect=True, returnout=False, ignore
159159
self.report.logpopen(popen, env=env)
160160
try:
161161
if resultjson and not redirect:
162-
assert popen.stderr is None # prevent deadlock
162+
if popen.stderr is not None:
163+
# prevent deadlock
164+
raise ValueError("stderr must not be piped here")
163165
# we read binary from the process and must write using a
164166
# binary stream
165167
buf = getattr(sys.stdout, 'buffer', sys.stdout)

0 commit comments

Comments
 (0)