From ac6a14055dc48faa67b147b07ab6ab79cedee03b Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Sat, 12 May 2018 02:22:26 +0200 Subject: [PATCH] [mod] lisibility --- src/yunohost/service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 9b4b8348e..b5908741f 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -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: