Skip to content

Commit

Permalink
Fix #659 (PageImage.debug_tablefinder())
Browse files Browse the repository at this point in the history
Thanks to @rneumann7 for flagging!
  • Loading branch information
jsvine committed May 31, 2022
1 parent a0988aa commit 063e2ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [0.7.1] - 2022-05-31

### Fixed

- Fix bug when calling `PageImage.debug_tablefinder()` (i.e., with no parameters). ([#659](https://github.com/jsvine/pdfplumber/issues/659)) [h/t @rneumann7]

## [0.7.0] - 2022-05-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion pdfplumber/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ def debug_tablefinder(
) -> "PageImage":
if isinstance(tf, TableFinder):
finder = tf
elif isinstance(tf, (TableSettings, dict)):
elif tf is None or isinstance(tf, (TableSettings, dict)):
finder = self.page.debug_tablefinder(tf)
else:
raise ValueError(
Expand Down
2 changes: 2 additions & 0 deletions tests/test_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def test_debug_tablefinder(self):
finder = TableFinder(self.im.page, settings)
self.im.debug_tablefinder(finder)

self.im.debug_tablefinder(None)

with pytest.raises(ValueError):
self.im.debug_tablefinder(0)

Expand Down

0 comments on commit 063e2ed

Please sign in to comment.