Properly handle PyZMQ >= 0.14 when freezing

This commit is contained in:
Pedro Algarvio 2014-02-25 22:52:02 +00:00
parent c5f294f1df
commit 13cfa54065

View file

@ -22,6 +22,12 @@ from distutils.command.clean import clean
from distutils.command.sdist import sdist
# pylint: enable=E0611
try:
import zmq
HAS_ZMQ = True
except ImportError:
HAS_ZMQ = False
# Change to salt source's directory prior to running any command
try:
SETUP_DIRNAME = os.path.dirname(__file__)
@ -517,6 +523,13 @@ FREEZER_INCLUDES = [
'email.mime.*',
]
if HAS_ZMQ and zmq.pyzmq_version_info() >= (0, 14):
# We're freezing, and when freezing ZMQ needs to be installed, so this
# works fine
if 'zmq.core.*' in FREEZER_INCLUDES:
# For PyZMQ >= 0.14, freezing does not need 'zmq.core.*'
FREEZER_INCLUDES.remove('zmq.core.*')
if IS_WINDOWS_PLATFORM:
FREEZER_INCLUDES.extend([
'win32api',