Skip to content

Commit 6bc5011

Browse files
committed
refactor post stop command execution for Python 2 and 3 compatibility
1 parent daa5fd0 commit 6bc5011

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
author="Chris McDonough",
9696
author_email="chrism@plope.com",
9797
packages=find_packages(),
98-
install_requires=[],
98+
install_requires=['subprocess32'] if py_version[0] == 2 else [],
9999
extras_require={
100100
'test': ['pytest', 'pytest-cov']
101101
},

supervisor/process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
import os
44
import signal
55
import shlex
6-
import subprocess
6+
try:
7+
import subprocess32 as subprocess
8+
except ImportError:
9+
import subprocess
710
import time
811
import traceback
912

0 commit comments

Comments
 (0)