[pypy-svn] r39007 - pypy/dist/pypy/doc

mwh at codespeak.net mwh at codespeak.net
Fri Feb 16 14:18:30 CET 2007


Author: mwh
Date: Fri Feb 16 14:18:29 2007
New Revision: 39007

Modified:
   pypy/dist/pypy/doc/conftest.py
Log:
protect against get_cmdline returning None.


Modified: pypy/dist/pypy/doc/conftest.py
==============================================================================
--- pypy/dist/pypy/doc/conftest.py	(original)
+++ pypy/dist/pypy/doc/conftest.py	Fri Feb 16 14:18:29 2007
@@ -75,11 +75,12 @@
         opt = getattr(h._cfgimpl_descr, n)
         # end horror
         cmdline = get_cmdline(opt.cmdline, text)
-        shortest_long_option = 'X'*1000
-        for cmd in cmdline.split():
-            if cmd.startswith('--') and len(cmd) < len(shortest_long_option):
-                shortest_long_option = cmd
-        text = shortest_long_option
+        if cmdline is not None:
+            shortest_long_option = 'X'*1000
+            for cmd in cmdline.split():
+                if cmd.startswith('--') and len(cmd) < len(shortest_long_option):
+                    shortest_long_option = cmd
+            text = shortest_long_option
         target = prefix + relative
         print text, target
         reference_node = nodes.reference(rawtext, text, name=text, refuri=target)



More information about the Pypy-commit mailing list