Fix #6764 (maximum_recursion_depth on shorten_components_to (function recursively calls itself on the same data))

This commit is contained in:
Kovid Goyal 2010-09-10 19:34:30 -06:00
parent f821c5721c
commit d1bbd2c498

View File

@ -55,6 +55,9 @@ def shorten_components_to(length, components):
else:
if x is components[-1]:
b, _, e = x.rpartition('.')
if not b and e:
b = e
e = ''
r = b[:-delta]+e
if r.startswith('.'): r = x[0]+r
else: