From cb1d7ee5cd7d1e5e7369286ea7d1dd5257c33970 Mon Sep 17 00:00:00 2001 From: y_benjo Date: Wed, 30 May 2018 08:18:53 +0900 Subject: [PATCH] check search result size and show min(len(result), count). --- rainbowstream/rainbow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rainbowstream/rainbow.py b/rainbowstream/rainbow.py index aded31d..2056c32 100644 --- a/rainbowstream/rainbow.py +++ b/rainbowstream/rainbow.py @@ -454,7 +454,7 @@ def search(): # Return results if rel: printNicely('Newest tweets:') - for i in reversed(xrange(count)): + for i in reversed(xrange(min(len(rel), count))): draw(t=rel[i], keyword=query) printNicely('') else: -- 2.25.1