From 19af00a378d2ff0bd181f4b6ec104434b08ba2d3 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 24 Jan 2024 12:54:21 +0100 Subject: [PATCH] fix --- behave/features/steps/other.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/behave/features/steps/other.py b/behave/features/steps/other.py index ad62fad98..3370e494b 100644 --- a/behave/features/steps/other.py +++ b/behave/features/steps/other.py @@ -22,8 +22,10 @@ # pylint: disable=missing-function-docstring,function-redefined -def _first_int(string): - for line in string.split("\n")[:5]: # first 5 lines +def _first_int(string, max_lines=20): + for line in string.split("\n")[:max_lines]: + if not line: + continue first_word = line.split()[0] if first_word.isdigit(): return first_word