Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nemu3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
nemu3
Commits
03768ca1
Commit
03768ca1
authored
May 16, 2024
by
Tom Niget
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement context manager protocol for Popen
parent
7050ad2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/nemu/subprocess_.py
src/nemu/subprocess_.py
+11
-0
No files found.
src/nemu/subprocess_.py
View file @
03768ca1
...
@@ -212,6 +212,17 @@ class Popen(Subprocess):
...
@@ -212,6 +212,17 @@ class Popen(Subprocess):
if
getattr
(
self
,
k
)
is
not
None
:
if
getattr
(
self
,
k
)
is
not
None
:
eintr_wrapper
(
os
.
close
,
v
)
eintr_wrapper
(
os
.
close
,
v
)
def
__enter__
(
self
):
return
self
def
__exit__
(
self
,
exc_type
,
exc_val
,
exc_tb
):
if
self
.
stdin
is
not
None
:
self
.
stdin
.
close
()
if
self
.
stdout
is
not
None
:
self
.
stdout
.
close
()
if
self
.
stderr
is
not
None
:
self
.
stderr
.
close
()
def
communicate
(
self
,
input
:
bytes
|
str
=
None
)
->
tuple
[
bytes
,
bytes
]:
def
communicate
(
self
,
input
:
bytes
|
str
=
None
)
->
tuple
[
bytes
,
bytes
]:
"""See Popen.communicate."""
"""See Popen.communicate."""
# FIXME: almost verbatim from stdlib version, need to be removed or
# FIXME: almost verbatim from stdlib version, need to be removed or
...
...
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