Commit fca3bb6a authored by Raymond Hettinger's avatar Raymond Hettinger

Explicitly use floor division

parent d058f08e
......@@ -99,7 +99,7 @@ def replace(text, *pairs):
def cram(text, maxlen):
"""Omit part of a string if needed to make it fit in a maximum length."""
if len(text) > maxlen:
pre = max(0, (maxlen-3)/2)
pre = max(0, (maxlen-3)//2)
post = max(0, maxlen-3-pre)
return text[:pre] + '...' + text[len(text)-post:]
return text
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment