]> granicus.if.org Git - python/commitdiff
Explicitly use floor division
authorRaymond Hettinger <python@rcn.com>
Mon, 21 Oct 2002 04:44:11 +0000 (04:44 +0000)
committerRaymond Hettinger <python@rcn.com>
Mon, 21 Oct 2002 04:44:11 +0000 (04:44 +0000)
Lib/pydoc.py

index ecee79b67d33f764c49764cd10cfda322a04fef2..e83e8951877a81dc32f9da5adba8e6e0484293c0 100755 (executable)
@@ -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