Skip to content

Commit a211f98

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

3 files changed

Lines changed: 9 additions & 3 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

supervisor/tests/test_process.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import errno
22
import os
33
import signal
4-
import subprocess
4+
try:
5+
import subprocess32 as subprocess
6+
except ImportError:
7+
import subprocess
58
import tempfile
69
import time
710
import unittest

0 commit comments

Comments
 (0)