Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c14c506b
Commit
c14c506b
authored
Nov 16, 2016
by
Xavier de Gaye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #26935: Fix broken Android dup2() in test_os
parent
0a5d8119
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
Lib/test/test_os.py
Lib/test/test_os.py
+7
-2
No files found.
Lib/test/test_os.py
View file @
c14c506b
...
...
@@ -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)
new_fd = f.fileno()
# Issue #26935: posix allows new_fd and fd to be equal but
# some libc implementations have dup2 return an error in this
# case.
if new_fd != fd:
os.dup2(new_fd, fd)
sys.stdout.buffer.write(os.urandom(4))
sys.stdout.buffer.write(os.urandom(4))
"""
.
format
(
TESTFN
=
support
.
TESTFN
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment