Appropriate error messaging when one of core libraries are missing due to erroneous Python build

This commit is contained in:
Miroslav Stampar 2013-07-13 16:07:36 +02:00
parent 4d9f8ad0dd
commit 31efabfca1

View File

@ -12,18 +12,18 @@ import StringIO
import struct import struct
try: try:
import bz2
import gzip import gzip
import sqlite3
import zlib import zlib
except ImportError: except ImportError, ex:
import lib.core.settings
from lib.core.data import logger from lib.core.data import logger
lib.core.settings.HTTP_ACCEPT_ENCODING_HEADER_VALUE = "identity" errMsg = "missing core libraries (bz2, gzip, sqlite3, zlib) "
errMsg += "probably because current version of Python has been "
errMsg = "turning off support for HTTP compressed encodings " errMsg += "built without appropriate dev packages"
errMsg += "because of lack of python compression "
errMsg += "modules ('gzip, zlib')"
logger.critical(errMsg) logger.critical(errMsg)
raise SystemExit
from lib.core.common import extractErrorMessage from lib.core.common import extractErrorMessage
from lib.core.common import extractRegexResult from lib.core.common import extractRegexResult