| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* PkgConfigNotFound - not installed
* PkgConfigError - base pkg-config errors
* PkgConfigModuleNotFound - pc file for module was not found
* PkgConfigModuleVersionNotFound - requested version was not found
Boilerplate now looks
```
from cffi.error import PkgConfigNotFound, PkgConfigError
...
try:
# try pkg-config way
ffibuilder.set_source(..., pkgconfig=["libczmq >= 4.0.0"])
except PkgConfigNotFound as e:
# if pkg-config is not installed, try backup
ffibuilder.set_source(..., libraries=["czmq", "zmq", "uuid", "pgm"])
except PkgConfigError as e:
# here we catch both PkgConfigModuleNotFound and PkgConfigModuleVersionNotFound
# and raise it again - simply to show they are raised
raise e from None
```
|