Modify ↓
#12558 closed enhancement (fixed)
Add contextmanager for Popen
| Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.3.1 |
| Component: | general | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: |
Added context manager for |
||
| Internal Changes: |
Refactored code to use |
||
Description
I'm using Popen in a test case and rather than duplicate code again for closing the file descriptors, I thought I would investigate the following idea.
The Popen class has a context manager since Python 3.2. We could subclass Popen in trac.util.compat and copy the __enter__ and __exit__ methods.
Attachments (0)
Change History (5)
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Committed to trunk in r15077.
comment:4 by , 9 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:5 by , 6 years ago
Note:
See TracTickets
for help on using tickets.



Proposed changes in log:rjollos.git:t12558_popen.1.