Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97367:e21fdbdb7131
Date: 2019-09-02 10:09 +0300
http://bitbucket.org/pypy/pypy/changeset/e21fdbdb7131/
Log: test fix 2c1cb3a4c2c5 for non-error condition
diff --git a/pypy/interpreter/test/test_objspace.py
b/pypy/interpreter/test/test_objspace.py
--- a/pypy/interpreter/test/test_objspace.py
+++ b/pypy/interpreter/test/test_objspace.py
@@ -453,7 +453,8 @@
import sys
sys.exitfunc = lambda: this_is_an_unknown_name
""")
- space.finish()
+ ret = space.finish()
+ assert ret == 0
# assert that we reach this point without getting interrupted
def test_exit_closed_std(self):
diff --git a/pypy/module/sys/moduledef.py b/pypy/module/sys/moduledef.py
--- a/pypy/module/sys/moduledef.py
+++ b/pypy/module/sys/moduledef.py
@@ -174,6 +174,7 @@
def flush_std_files(self, space):
w_stdout = space.sys.getdictvalue(space, 'stdout')
w_stderr = space.sys.getdictvalue(space, 'stderr')
+ ret = 0
for w_file in [w_stdout, w_stderr]:
if not (space.is_none(w_file) or
self._file_is_closed(space, w_file)):
@@ -182,6 +183,8 @@
except OperationError as e:
if w_file is w_stdout:
e.write_unraisable(space, '', w_file)
+ ret = -1
+ return ret
def _file_is_closed(self, space, w_file):
try:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit