Cause ImportError from failed dlopen of the rdBase.so shared library to propagate. (#1032)

Without this, it's very easy to get a SegFault when importing RDKit
binaries into a python interpreter with a UCS2 vs UCS4 symbol
mismatch. For example:

$ python -c "import rdkit.rdBase"
Segmentation fault

A UCS2 vs UCS4 mismatch should throw the more intelligible stack trace:

$ python -c "import rdkit.rdBase"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "rdkit/__init__.py", line 2, in <module>
    from .rdBase import rdkitVersion as __version__
ImportError: /path/to/lib/libboost_python.so.1.59.0: undefined symbol: PyUnicodeUCS2_FromEncodedObject
This commit is contained in:
Brian Cole
2016-08-16 23:06:13 -04:00
committed by Greg Landrum
parent 4a675c631c
commit b392f893c5

View File

@@ -2,4 +2,5 @@ try:
from .rdBase import rdkitVersion as __version__
except ImportError:
__version__='Unknown'
raise