[pypy-svn] rev 2449 - pypy/trunk/src/pypy/module

jacob at codespeak.net jacob at codespeak.net
Wed Dec 17 16:03:10 CET 2003


Author: jacob
Date: Wed Dec 17 16:03:10 2003
New Revision: 2449

Modified:
   pypy/trunk/src/pypy/module/builtin.py
Log:
Added type check to intern to mimic CPython

Modified: pypy/trunk/src/pypy/module/builtin.py
==============================================================================
--- pypy/trunk/src/pypy/module/builtin.py	(original)
+++ pypy/trunk/src/pypy/module/builtin.py	Wed Dec 17 16:03:10 2003
@@ -669,6 +669,8 @@
         We don't have a string table, making intern a null operation.
         This is here for backwards compatibility.
         """
+        if not isinstance(s, str):
+            raise TypeError("intern() argument 1 must be string.")
         return s
     
 # source code for the builtin xrange-class


More information about the Pypy-commit mailing list