[pypy-svn] r13904 - pypy/dist/pypy/rpython

mwh at codespeak.net mwh at codespeak.net
Sat Jun 25 20:35:17 CEST 2005


Author: mwh
Date: Sat Jun 25 20:35:17 2005
New Revision: 13904

Modified:
   pypy/dist/pypy/rpython/lltype.py
Log:
Catch a particular type of bug much earlier.


Modified: pypy/dist/pypy/rpython/lltype.py
==============================================================================
--- pypy/dist/pypy/rpython/lltype.py	(original)
+++ pypy/dist/pypy/rpython/lltype.py	Sat Jun 25 20:35:17 2005
@@ -744,6 +744,10 @@
 def functionptr(TYPE, name, **attrs):
     if not isinstance(TYPE, FuncType):
         raise TypeError, "functionptr() for FuncTypes only"
+    try:
+        hash(tuple(attrs.items()))
+    except TypeError:
+        raise TypeError("'%r' must be hashable"%attrs)
     o = _func(TYPE, _name=name, **attrs)
     return _ptr(Ptr(TYPE), o)
 



More information about the Pypy-commit mailing list