Skip to content

Commit

Permalink
Remove unreachable code that checking for None cell
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn <[email protected]>
  • Loading branch information
Shawn committed Apr 22, 2021
1 parent bdce628 commit 1391153
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions pdfplumber/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,15 @@ def char_in_bbox(char, bbox):
row_chars = [char for char in chars if char_in_bbox(char, row.bbox)]

for cell in row.cells:
if cell is None:
cell_text = None
else:
cell_chars = [
char for char in row_chars if char_in_bbox(char, cell)
]

if len(cell_chars):
cell_text = utils.extract_text(
cell_chars,
x_tolerance=x_tolerance,
y_tolerance=y_tolerance,
).strip()
else:
cell_text = ""
cell_chars = [char for char in row_chars if char_in_bbox(char, cell)]

cell_text = ""
if len(cell_chars):
cell_text = utils.extract_text(
cell_chars,
x_tolerance=x_tolerance,
y_tolerance=y_tolerance,
).strip()
arr.append(cell_text)
table_arr.append(arr)

Expand Down

0 comments on commit 1391153

Please sign in to comment.