Use thread-safe subprocess32 on Py2
This commit is contained in:
parent
8d63ae1ac5
commit
31ace18e1c
|
@ -31,7 +31,6 @@ the current version
|
|||
"""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
from time import clock
|
||||
try:
|
||||
|
@ -47,6 +46,16 @@ from .constants import *
|
|||
import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
if os.name == "posix" and sys.version_info[0] < 3:
|
||||
try:
|
||||
import subprocess32 as subprocess
|
||||
except ImportError:
|
||||
log.debug("Thread-safe subprocess32 module not found! "
|
||||
"Using unsafe built-in subprocess module instead.")
|
||||
import subprocess
|
||||
else:
|
||||
import subprocess
|
||||
|
||||
class PulpSolverError(PulpError):
|
||||
"""
|
||||
Pulp Solver-related exceptions
|
||||
|
|
Loading…
Reference in New Issue