From ba1604ee401aa133a940cd338381fefa316ade85 Mon Sep 17 00:00:00 2001 From: Idan David Date: Sun, 5 Apr 2020 20:01:29 +0300 Subject: [PATCH] Fix deepsource problems --- camelot/parsers/stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/camelot/parsers/stream.py b/camelot/parsers/stream.py index deb61eb..ac1f774 100644 --- a/camelot/parsers/stream.py +++ b/camelot/parsers/stream.py @@ -289,7 +289,7 @@ class Stream(BaseParser): # guess table areas using textlines and relevant edges table_bbox = textedges.get_table_areas(textlines, relevant_textedges) # treat whole page as table area if no table areas found - if not len(table_bbox): + if not table_bbox: table_bbox = {(0, 0, self.pdf_width, self.pdf_height): None} return table_bbox @@ -366,7 +366,7 @@ class Stream(BaseParser): # see if the list contains elements, if yes, then use # the mode after removing 1s elements = list(filter(lambda x: x != 1, elements)) - if len(elements): + if elements: ncols = max(set(elements), key=elements.count) else: warnings.warn(