Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closes #1173 - backporting python2.7 subprocess's check_output to be abl... #1174

Merged
merged 3 commits into from Sep 1, 2012
Merged

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Aug 30, 2012

...e to support python 2.6

I've added a new module called utils, in which I copy pasted the python2.7 subprocess check_output method. If the subprocess module has it (python 2.7 and above) it will use the stdlib version. Else, it will used the copy pasted 2.7 version.

I then modified the pgf's backend to use this method instead of the one provided in subprocess.

this patch closes #1173

@travisbot
Copy link

This pull request fails (merged 0a0ac8c into cf7618c).

if hasattr(subprocess, 'check_output'):
check_output = subprocess.check_output
else:
check_output = _check_output
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to see this added to cbook.py, the current location for utility functions. cbook is large and disorganized, but I'd rather do that reorganization properly than start adding things in unexpected places right now.

@mdboom
Copy link
Member

mdboom commented Aug 30, 2012

Other than my comment about where check_output should go, I think this is a great solution. Any you're right -- there are some other places that use subprocess that probably should start using this, but that doesn't need to be done for the 1.2 release. (They don't now because the code probably predates Python 2.7).

@travisbot
Copy link

This pull request fails (merged 5db0cce into cf7618c).

@NelleV
Copy link
Member Author

NelleV commented Aug 30, 2012

I was not aware cbooks was the default place to put the utility function: I've moved it there and the tests on this module run fine on python2.6 !

@travisbot
Copy link

This pull request fails (merged ea88b7f into cf7618c).

@pelson
Copy link
Member

pelson commented Sep 1, 2012

Looks good to me. Will merge in 24 hours.

efiring added a commit that referenced this pull request Sep 1, 2012
closes #1173 - backporting python2.7 subprocess's check_output to be abl...
@efiring efiring merged commit f8368d0 into matplotlib:master Sep 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The PGF backend only works on python2.7 and +
5 participants