cpython: da59b7084dbe (original) (raw)
Mercurial > cpython
changeset 105145:da59b7084dbe
Issue #26935: Merge 3.6 [#26935]
Xavier de Gaye xdegaye@users.sourceforge.net | |
---|---|
date | Wed, 16 Nov 2016 08:06:12 +0100 |
parents | f358d849c14e(current diff)80e4cb5888f3(diff) |
children | 6f0f77333da5 |
files | |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-)[+] [-] Lib/test/test_os.py 9 |
line wrap: on
line diff
--- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -56,7 +56,7 @@ except ImportError: try: import pwd all_users = [u.pw_uid for u in pwd.getpwall()] -except ImportError: +except (ImportError, AttributeError): all_users = [] try: from _testcapi import INT_MAX, PY_SSIZE_T_MAX @@ -1423,7 +1423,12 @@ class URandomFDTests(unittest.TestCase): break os.closerange(3, 256) with open({TESTFN!r}, 'rb') as f:
os.dup2(f.fileno(), fd)[](#l1.16)
new_fd = f.fileno()[](#l1.17)
# Issue #26935: posix allows new_fd and fd to be equal but[](#l1.18)
# some libc implementations have dup2 return an error in this[](#l1.19)
# case.[](#l1.20)
if new_fd != fd:[](#l1.21)
os.dup2(new_fd, fd)[](#l1.22) sys.stdout.buffer.write(os.urandom(4))[](#l1.23) sys.stdout.buffer.write(os.urandom(4))[](#l1.24) """.format(TESTFN=support.TESTFN)[](#l1.25)