|
9 | 9 | import os
|
10 | 10 | import re
|
11 | 11 | import subprocess
|
| 12 | +from subprocess import check_output |
12 | 13 | import sys
|
13 | 14 | import warnings
|
14 | 15 | from textwrap import fill
|
|
19 | 20 | PY3 = (sys.version_info[0] >= 3)
|
20 | 21 |
|
21 | 22 |
|
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 |
| - """ |
34 |
| - 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 |
| - |
48 | 23 | if sys.platform != 'win32':
|
49 | 24 | if sys.version_info[0] < 3:
|
50 | 25 | from commands import getstatusoutput
|
@@ -554,13 +529,13 @@ def check(self):
|
554 | 529 |
|
555 | 530 | if major < 2:
|
556 | 531 | raise CheckFailed(
|
557 |
| - "Requires Python 2.6 or later") |
558 |
| - elif major == 2 and minor1 < 6: |
| 532 | + "Requires Python 2.7 or later") |
| 533 | + elif major == 2 and minor1 < 7: |
559 | 534 | raise CheckFailed(
|
560 |
| - "Requires Python 2.6 or later (in the 2.x series)") |
561 |
| - elif major == 3 and minor1 < 1: |
| 535 | + "Requires Python 2.7 or later (in the 2.x series)") |
| 536 | + elif major == 3 and minor1 < 4: |
562 | 537 | raise CheckFailed(
|
563 |
| - "Requires Python 3.1 or later (in the 3.x series)") |
| 538 | + "Requires Python 3.4 or later (in the 3.x series)") |
564 | 539 |
|
565 | 540 | return sys.version
|
566 | 541 |
|
|
0 commit comments