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
045e4579
Commit
045e4579
authored
Jun 10, 2013
by
Richard Oudkerk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #18174: Fix fd leaks in tests.
parent
0e6283e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
Lib/test/test_openpty.py
Lib/test/test_openpty.py
+2
-0
Lib/test/test_subprocess.py
Lib/test/test_subprocess.py
+2
-1
Lib/test/test_uuid.py
Lib/test/test_uuid.py
+1
-0
No files found.
Lib/test/test_openpty.py
View file @
045e4579
...
...
@@ -10,6 +10,8 @@ if not hasattr(os, "openpty"):
class
OpenptyTest
(
unittest
.
TestCase
):
def
test
(
self
):
master
,
slave
=
os
.
openpty
()
self
.
addCleanup
(
os
.
close
,
master
)
self
.
addCleanup
(
os
.
close
,
slave
)
if
not
os
.
isatty
(
slave
):
self
.
fail
(
"Slave-end of pty is not a terminal."
)
...
...
Lib/test/test_subprocess.py
View file @
045e4579
...
...
@@ -806,7 +806,8 @@ class POSIXProcessTestCase(BaseTestCase):
self
.
_testcase
.
assertNotIn
(
fd
,
(
p2cwrite
,
c2pread
,
errread
))
finally
:
map
(
os
.
close
,
devzero_fds
)
for
fd
in
devzero_fds
:
os
.
close
(
fd
)
@
unittest
.
skipIf
(
not
os
.
path
.
exists
(
"/dev/zero"
),
"/dev/zero required."
)
def
test_preexec_errpipe_does_not_double_close_pipes
(
self
):
...
...
Lib/test/test_uuid.py
View file @
045e4579
...
...
@@ -448,6 +448,7 @@ class TestUUID(unittest.TestCase):
else
:
os
.
close
(
fds
[
1
])
self
.
addCleanup
(
os
.
close
,
fds
[
0
])
parent_value
=
uuid
.
uuid4
().
hex
os
.
waitpid
(
pid
,
0
)
child_value
=
os
.
read
(
fds
[
0
],
100
)
...
...
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