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

pedronis at codespeak.net pedronis at codespeak.net
Sat Jul 23 00:26:12 CEST 2005


Author: pedronis
Date: Sat Jul 23 00:26:11 2005
New Revision: 14945

Modified:
   pypy/dist/pypy/rpython/rstr.py
Log:
sanity check the join method argument



Modified: pypy/dist/pypy/rpython/rstr.py
==============================================================================
--- pypy/dist/pypy/rpython/rstr.py	(original)
+++ pypy/dist/pypy/rpython/rstr.py	Sat Jul 23 00:26:11 2005
@@ -123,6 +123,9 @@
         if hop.s_result.is_constant():
             return inputconst(string_repr, hop.s_result.const)
         r_lst = hop.args_r[1]
+        from pypy.rpython.rlist import ListRepr
+        if not isinstance(r_lst, ListRepr):
+            raise TyperError("string.join of non-list: %r" % r_lst)
         v_str, v_lst = hop.inputargs(string_repr, r_lst)
         cname = inputconst(Void, "items")
         v_items = hop.genop("getfield", [v_lst, cname],



More information about the Pypy-commit mailing list