diff --git a/compose/service.py b/compose/service.py index 73d38287c..987ba64f1 100644 --- a/compose/service.py +++ b/compose/service.py @@ -6,7 +6,6 @@ import json import logging import os import re -import subprocess import sys import tempfile from collections import namedtuple @@ -62,6 +61,11 @@ from .utils import parse_seconds_float from .utils import truncate_id from .utils import unique_everseen +if six.PY2: + import subprocess32 as subprocess +else: + import subprocess + log = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index 4b47c8bf1..c3e214c22 100644 --- a/setup.py +++ b/setup.py @@ -52,6 +52,7 @@ if sys.version_info[:2] < (3, 4): tests_require.append('mock >= 1.0.1, < 4') extras_require = { + ':python_version < "3.2"': ['subprocess32 >= 3.5.4, < 4'], ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2'], ':python_version < "3.5"': ['backports.ssl_match_hostname >= 3.5, < 4'], ':python_version < "3.3"': ['ipaddress >= 1.0.16, < 2'],