diff options
author | Armin Rigo <arigo@tunes.org> | 2019-01-31 22:42:59 +0100 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2019-01-31 22:42:59 +0100 |
commit | c83a919fdc567e0709fae82ca53cf83bde625814 (patch) | |
tree | c614a0c49fe9cc166e6f712ea3e9aa5989cf5558 /lib_pypy/cffi | |
parent | Issue #2945 (diff) | |
download | pypy-c83a919fdc567e0709fae82ca53cf83bde625814.tar.gz pypy-c83a919fdc567e0709fae82ca53cf83bde625814.tar.bz2 pypy-c83a919fdc567e0709fae82ca53cf83bde625814.zip |
update to cffi/59b8d697b9b9
Diffstat (limited to 'lib_pypy/cffi')
-rw-r--r-- | lib_pypy/cffi/__init__.py | 1 | ||||
-rw-r--r-- | lib_pypy/cffi/api.py | 10 | ||||
-rw-r--r-- | lib_pypy/cffi/error.py | 10 |
3 files changed, 20 insertions, 1 deletions
diff --git a/lib_pypy/cffi/__init__.py b/lib_pypy/cffi/__init__.py index ec479b7b2f..157a2150e0 100644 --- a/lib_pypy/cffi/__init__.py +++ b/lib_pypy/cffi/__init__.py @@ -3,6 +3,7 @@ __all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError', from .api import FFI from .error import CDefError, FFIError, VerificationError, VerificationMissing +from .error import PkgConfigError __version__ = "1.12.0" __version_info__ = (1, 12, 0) diff --git a/lib_pypy/cffi/api.py b/lib_pypy/cffi/api.py index f4c4ddc95a..722c2f154a 100644 --- a/lib_pypy/cffi/api.py +++ b/lib_pypy/cffi/api.py @@ -643,6 +643,16 @@ class FFI(object): self._assigned_source = (str(module_name), source, source_extension, kwds) + def set_source_pkgconfig(self, module_name, pkgconfig_libs, source, + source_extension='.c', **kwds): + from . import pkgconfig + if not isinstance(pkgconfig_libs, list): + raise TypeError("the pkgconfig_libs argument must be a list " + "of package names") + kwds2 = pkgconfig.flags_from_pkgconfig(pkgconfig_libs) + pkgconfig.merge_flags(kwds, kwds2) + self.set_source(module_name, source, source_extension, **kwds) + def distutils_extension(self, tmpdir='build', verbose=True): from distutils.dir_util import mkpath from .recompiler import recompile diff --git a/lib_pypy/cffi/error.py b/lib_pypy/cffi/error.py index ec19964843..0a27247c32 100644 --- a/lib_pypy/cffi/error.py +++ b/lib_pypy/cffi/error.py @@ -1,8 +1,9 @@ class FFIError(Exception): - pass + __module__ = 'cffi' class CDefError(Exception): + __module__ = 'cffi' def __str__(self): try: current_decl = self.args[1] @@ -16,8 +17,15 @@ class CDefError(Exception): class VerificationError(Exception): """ An error raised when verification fails """ + __module__ = 'cffi' class VerificationMissing(Exception): """ An error raised when incomplete structures are passed into cdef, but no verification has been done """ + __module__ = 'cffi' + +class PkgConfigError(Exception): + """ An error raised for missing modules in pkg-config + """ + __module__ = 'cffi' |