Edgewall Software

Opened 8 years ago

Last modified 4 years ago

#12558 closed enhancement

Add contextmanager for Popen — at Initial Version

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:
Internal Changes:

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.

Change History (0)

Note: See TracTickets for help on using tickets.