[Scipy-svn] r6370 - trunk/scipy/ndimage

scipy-svn at scipy.org scipy-svn at scipy.org
Sat May 8 04:42:59 EDT 2010


Author: rgommers
Date: 2010-05-08 03:42:59 -0500 (Sat, 08 May 2010)
New Revision: 6370

Modified:
   trunk/scipy/ndimage/doccer.py
Log:
Add exception handling to docformat for very short or empty strings.

Modified: trunk/scipy/ndimage/doccer.py
===================================================================
--- trunk/scipy/ndimage/doccer.py	2010-05-04 06:43:01 UTC (rev 6369)
+++ trunk/scipy/ndimage/doccer.py	2010-05-08 08:42:59 UTC (rev 6370)
@@ -52,10 +52,13 @@
     indented = {}
     for name, dstr in docdict.items():
         lines = dstr.expandtabs().splitlines()
-        newlines = [lines[0]]
-        for line in lines[1:]:
-            newlines.append(indent+line)
-        indented[name] = '\n'.join(newlines)
+        try:
+            newlines = [lines[0]]
+            for line in lines[1:]:
+                newlines.append(indent+line)
+            indented[name] = '\n'.join(newlines)
+        except IndexError:
+            indented[name] = dstr
     return docstring % indented
 
 




More information about the Scipy-svn mailing list