Skip to content

Commit dbfba16

Browse files
author
Victor Stinner
committed
Close #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.
1 parent a539245 commit dbfba16

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

Lib/pydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,9 @@ def preformat(self, text):
478478
def multicolumn(self, list, format, cols=4):
479479
"""Format a list of items into a multi-column list."""
480480
result = ''
481-
rows = (len(list)+cols-1)/cols
481+
rows = (len(list)+cols-1)//cols
482482
for col in range(cols):
483-
result = result + '<td width="%d%%" valign=top>' % (100/cols)
483+
result = result + '<td width="%d%%" valign=top>' % (100//cols)
484484
for i in range(rows*col, rows*col+rows):
485485
if i < len(list):
486486
result = result + format(list[i]) + '<br>\n'

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ Hannu Krosing
458458
Andrej Krpic
459459
Ivan Krstić
460460
Andrew Kuchling
461+
Ralf W. Grosse-Kunstleve
461462
Vladimir Kushnir
462463
Ross Lagerwall
463464
Cameron Laird

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ Core and Builtins
8383
Library
8484
-------
8585

86+
- Issue #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
87+
division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.
88+
8689
- Issue #12175: RawIOBase.readall() now returns None if read() returns None.
8790

8891
- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError

0 commit comments

Comments
 (0)