mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Close #12182: Fix pydoc.HTMLDoc.multicolumn() if Python uses the new (true)
division (python -Qnew). Patch written by Ralf W. Grosse-Kunstleve.
This commit is contained in:
parent
a5392455f6
commit
dbfba1667c
3 changed files with 6 additions and 2 deletions
|
@ -478,9 +478,9 @@ class HTMLDoc(Doc):
|
||||||
def multicolumn(self, list, format, cols=4):
|
def multicolumn(self, list, format, cols=4):
|
||||||
"""Format a list of items into a multi-column list."""
|
"""Format a list of items into a multi-column list."""
|
||||||
result = ''
|
result = ''
|
||||||
rows = (len(list)+cols-1)/cols
|
rows = (len(list)+cols-1)//cols
|
||||||
for col in range(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):
|
for i in range(rows*col, rows*col+rows):
|
||||||
if i < len(list):
|
if i < len(list):
|
||||||
result = result + format(list[i]) + '<br>\n'
|
result = result + format(list[i]) + '<br>\n'
|
||||||
|
|
|
@ -458,6 +458,7 @@ Hannu Krosing
|
||||||
Andrej Krpic
|
Andrej Krpic
|
||||||
Ivan Krstić
|
Ivan Krstić
|
||||||
Andrew Kuchling
|
Andrew Kuchling
|
||||||
|
Ralf W. Grosse-Kunstleve
|
||||||
Vladimir Kushnir
|
Vladimir Kushnir
|
||||||
Ross Lagerwall
|
Ross Lagerwall
|
||||||
Cameron Laird
|
Cameron Laird
|
||||||
|
|
|
@ -83,6 +83,9 @@ Core and Builtins
|
||||||
Library
|
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: RawIOBase.readall() now returns None if read() returns None.
|
||||||
|
|
||||||
- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
|
- Issue #12175: FileIO.readall() now raises a ValueError instead of an IOError
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue