8000 Remove python2.6 backport in setupext · matplotlib/matplotlib@f39b388 · GitHub
[go: up one dir, main page]

Skip to content

Commit f39b388

Browse files
committed
Remove python2.6 backport in setupext
1 parent aaa34e0 commit f39b388

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

setupext.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010
import re
1111
import subprocess
12+
from subprocess import check_output
1213
import sys
1314
import warnings
1415
from textwrap import fill
@@ -19,32 +20,6 @@
1920
PY3 = (sys.version_info[0] >= 3)
2021

2122

22-
try:
23-
from subprocess import check_output
24-
except ImportError:
25-
# check_output is not available in Python 2.6
26-
def check_output(*popenargs, **kwargs):
27-
"""
28-
Run command with arguments and return its output as a byte
29-
string.
30-
31-
Backported from Python 2.7 as it's implemented as pure python
32-
on stdlib.
33-
"""
3 98D0 4-
process = subprocess.Popen(
35-
stdout=subprocess.PIPE, *popenargs, **kwargs)
36-
output, unused_err = process.communicate()
37-
retcode = process.poll()
38-
if retcode:
39-
cmd = kwargs.get("args")
40-
if cmd is None:
41-
cmd = popenargs[0]
42-
error = subprocess.CalledProcessError(retcode, cmd)
43-
error.output = output
44-
raise error
45-
return output
46-
47-
4823
if sys.platform != 'win32':
4924
if sys.version_info[0] < 3:
5025
from commands import getstatusoutput

0 commit comments

Comments
 (0)
0