[pypy-svn] r69242 - pypy/branch/faster-raise/pypy/tool

arigo at codespeak.net arigo at codespeak.net
Thu Nov 12 19:32:57 CET 2009


Author: arigo
Date: Thu Nov 12 19:32:57 2009
New Revision: 69242

Modified:
   pypy/branch/faster-raise/pypy/tool/sourcetools.py
Log:
Don't generate names that are incrediiiiibly long.


Modified: pypy/branch/faster-raise/pypy/tool/sourcetools.py
==============================================================================
--- pypy/branch/faster-raise/pypy/tool/sourcetools.py	(original)
+++ pypy/branch/faster-raise/pypy/tool/sourcetools.py	Thu Nov 12 19:32:57 2009
@@ -236,12 +236,13 @@
                            'a' <= chr(i) <= 'z' or
                            'A' <= chr(i) <= 'Z') and chr(i) or '_')
                          for i in range(256)])
+PY_IDENTIFIER_MAX = 120
 
 def valid_identifier(stuff):
     stuff = str(stuff).translate(PY_IDENTIFIER)
     if not stuff or ('0' <= stuff[0] <= '9'):
         stuff = '_' + stuff
-    return stuff
+    return stuff[:PY_IDENTIFIER_MAX]
 
 CO_VARARGS      = 0x0004
 CO_VARKEYWORDS  = 0x0008



More information about the Pypy-commit mailing list