Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r71484:769e23925b13
Date: 2014-05-13 11:23 +0200
http://bitbucket.org/pypy/pypy/changeset/769e23925b13/

Log:    make it a clear error

diff --git a/lib_pypy/gdbm.py b/lib_pypy/gdbm.py
--- a/lib_pypy/gdbm.py
+++ b/lib_pypy/gdbm.py
@@ -44,6 +44,8 @@
     pass
 
 def _fromstr(key):
+    if not isinstance(key, str):
+        raise TypeError("gdbm mappings have string indices only")
     return {'dptr': ffi.new("char[]", key), 'dsize': len(key)}
 
 class gdbm(object):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to