From 9766a8cd9c0fdca99b566040db9b8e479c37b40d Mon Sep 17 00:00:00 2001 From: Haider Ali Date: Thu, 18 Oct 2018 10:29:47 +0530 Subject: [PATCH] optimized tail.py --- lust/tail.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lust/tail.py b/lust/tail.py index 0cf28f4..d3a6df0 100644 --- a/lust/tail.py +++ b/lust/tail.py @@ -8,9 +8,7 @@ def file_rotated(file_name, orig_stat): try: new_stat = os.stat(file_name) - if orig_stat == None: - return True, new_stat - elif orig_stat.st_ino != new_stat.st_ino: + if orig_stat == None or orig_stat.st_ino != new_stat.st_ino: return True, new_stat else: return False, orig_stat