isagalaev/ijson — pull request #22 by asilvestre (2014-04-30 10:05:03+00:00)
Title: Handle very old YAJL without yajl_version method

old yajl versions don't have the yajl_version method and produce an AttributeError when importing ijson.

See the following backtrace:

ERROR: Failure: AttributeError (/usr/lib64/libyajl.so.1: undefined symbol: yajl_version)

Traceback (most recent call last):
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/nose/loader.py line 413 in loadTestsFromName
addr.filename, addr.module)
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/nose/importer.py line 47 in importFromPath
return self.importFromDir(dir_path, fqname)
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/nose/importer.py line 94 in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
tests/__init__.py line 6 in
from contpublisher import requestmanager
src/contpublisher/requestmanager.py line 32 in
from contpublisher import cdnmanager
src/contpublisher/cdnmanager.py line 12 in
import ijson.backends.python as ijson
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/ijson/__init__.py line 21 in
import ijson.backends.yajl2 as backend
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/ijson/backends/yajl2.py line 14 in
yajl = backends.find_yajl(2)
.venv/contentpublisher-3.0.0-Linux/lib/python2.6/site-packages/ijson/backends/__init__.py line 11 in find_yajl
major, rest = divmod(yajl.yajl_version(), 10000)
/usr/lib64/python2.6/ctypes/__init__.py line 366 in __getattr__
func = self.__getitem__(name)
/usr/lib64/python2.6/ctypes/__init__.py line 371 in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib64/libyajl.so.1: undefined symbol: yajl_version