From 85b530a7599e06fbe21633a6c62fb3d2abf7825e Mon Sep 17 00:00:00 2001 From: Nick Erickson Date: Thu, 4 Apr 2024 00:10:52 -0700 Subject: [PATCH] Fix tail exception when from_line=None (#615) --- amlb/utils/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amlb/utils/core.py b/amlb/utils/core.py index e37f25984..130e910fc 100644 --- a/amlb/utils/core.py +++ b/amlb/utils/core.py @@ -361,7 +361,7 @@ def head(s, lines=10, splitlines=False): def tail(s, lines=10, from_line=None, include_line=True, splitlines=False): if s is None: - return None if from_line is None else None, None + return None, None s_lines = s.splitlines() start = -lines @@ -380,7 +380,7 @@ def tail(s, lines=10, from_line=None, include_line=True, splitlines=False): line=s_lines[-1] if len(s_lines) > 0 else None) s_lines = s_lines[start:] t = s_lines if splitlines else '\n'.join(s_lines) - return t if from_line is None else (t, last_line) + return (t, None) if from_line is None else (t, last_line) def fn_name(fn):