Author: Armin Rigo <[email protected]>
Branch:
Changeset: r2736:18cdf37d6b26
Date: 2016-08-07 12:25 +0200
http://bitbucket.org/cffi/cffi/changeset/18cdf37d6b26/
Log: Eventually, replace this UserWarning with an error
diff --git a/cffi/model.py b/cffi/model.py
--- a/cffi/model.py
+++ b/cffi/model.py
@@ -519,12 +519,10 @@
smallest_value = min(self.enumvalues)
largest_value = max(self.enumvalues)
else:
- import warnings
- warnings.warn("%r has no values explicitly defined; next version "
- "will refuse to guess which integer type it is "
- "meant to be (unsigned/signed, int/long)"
- % self._get_c_name())
- smallest_value = largest_value = 0
+ raise api.CDefError("%r has no values explicitly defined: "
+ "refusing to guess which integer type it is "
+ "meant to be (unsigned/signed, int/long)"
+ % self._get_c_name())
if smallest_value < 0: # needs a signed type
sign = 1
candidate1 = PrimitiveType("int")
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit