[pypy-svn] r18175 - pypy/dist/pypy/interpreter/pyparser

ac at codespeak.net ac at codespeak.net
Tue Oct 4 23:34:30 CEST 2005


Author: ac
Date: Tue Oct  4 23:34:30 2005
New Revision: 18175

Modified:
   pypy/dist/pypy/interpreter/pyparser/pythonparse.py
Log:
Account for a possibly empty string.

Modified: pypy/dist/pypy/interpreter/pyparser/pythonparse.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/pythonparse.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/pythonparse.py	Tue Oct  4 23:34:30 2005
@@ -39,7 +39,7 @@
 
         lines = [line + '\n' for line in textsrc.split('\n')]
         builder.source_encoding = enc
-        if textsrc[-1] =='\n':
+        if len(textsrc) and textsrc[-1] == '\n':
             lines.pop()
             flags &= ~PyCF_DONT_IMPLY_DEDENT
         return self.parse_lines(lines, goal, builder, flags)



More information about the Pypy-commit mailing list