From 719a1b05818cc0dcb4515dc3a704e468061b2455 Mon Sep 17 00:00:00 2001 From: Nao YONASHIRO Date: Thu, 29 Aug 2019 19:56:31 +0900 Subject: [PATCH] fix: use subprocess32 for python2 Signed-off-by: Nao YONASHIRO --- compose/service.py | 6 +++++- setup.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) 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'],