summaryrefslogtreecommitdiff
path: root/cffi/api.py
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2015-05-11 11:53:11 +0200
committerArmin Rigo <arigo@tunes.org>2015-05-11 11:53:11 +0200
commit8dfeffefd777fa157b84df19339c516a4061c1c8 (patch)
treea8ff08f3508bbc212213d9473ae85e71a099970e /cffi/api.py
parent400ccd0bef07fa33a39eb959e6163eaede25191b (diff)
downloadcffi-8dfeffefd777fa157b84df19339c516a4061c1c8.tar.gz
A case where raising NotImplementedError is more appropriate than just
AttributeError
Diffstat (limited to 'cffi/api.py')
-rw-r--r--cffi/api.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cffi/api.py b/cffi/api.py
index 1544476..fb5e596 100644
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -583,6 +583,11 @@ def _make_ffi_library(ffi, libname, flags):
if name in library.__dict__:
return
#
+ key = 'constant ' + name
+ if key in ffi._parser._declarations:
+ raise NotImplementedError("fetching a non-integer constant "
+ "after dlopen()")
+ #
raise AttributeError(name)
#
def make_accessor(name):