[mod] lisibility

This commit is contained in:
Laurent Peuch 2018-05-12 02:22:26 +02:00
parent 14c270cebd
commit ac6a14055d

View file

@ -632,10 +632,13 @@ def _tail(file, n):
# woops. apparently file is smaller than what we want
# to step back, go to the beginning instead
f.seek(0)
pos = f.tell()
lines = f.read().splitlines()
if len(lines) >= to_read or pos == 0:
return lines[-to_read]
avg_line_length *= 1.3
except IOError: