]> granicus.if.org Git - python/commitdiff
Close #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
authorVictor Stinner <victor.stinner@haypocalc.com>
Thu, 26 May 2011 11:37:25 +0000 (13:37 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Thu, 26 May 2011 11:37:25 +0000 (13:37 +0200)
division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.

Lib/pydoc.py
Misc/ACKS
Misc/NEWS

index 8b6f7ee2e3ec073a0440402fe7250c395c62de64..f11940438ccd14da39fe84d415909fac567b9cdb 100755 (executable)
@@ -478,9 +478,9 @@ class HTMLDoc(Doc):
     def multicolumn(self, list, format, cols=4):
         """Format a list of items into a multi-column list."""
         result = ''
-        rows = (len(list)+cols-1)/cols
+        rows = (len(list)+cols-1)//cols
         for col in range(cols):
-            result = result + '<td width="%d%%" valign=top>' % (100/cols)
+            result = result + '<td width="%d%%" valign=top>' % (100//cols)
             for i in range(rows*col, rows*col+rows):
                 if i < len(list):
                     result = result + format(list[i]) + '<br>\n'
index 4270934f234f73dc2ddfc5963bdf9d0a85c0022c..164473f139f3636285f747a161aecbe27f905afc 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -458,6 +458,7 @@ Hannu Krosing
 Andrej Krpic
 Ivan Krstić
 Andrew Kuchling
+Ralf W. Grosse-Kunstleve
 Vladimir Kushnir
 Ross Lagerwall
 Cameron Laird
index 0f2049b003cabd93f14a9504307cdb7cb4bc5b19..e34bd486195462a533a4dbc7adb00315cf0fe746 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -83,6 +83,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
+  division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.
+
 - Issue #12175: RawIOBase.readall() now returns None if read() returns None.
 
 - Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError