Fix #659 (PageImage.debug_tablefinder())

Thanks to @rneumann7 for flagging!
This commit is contained in:
Jeremy Singer-Vine
2022-05-31 15:45:40 -04:00
parent a0988aa963
commit 063e2edd75
3 changed files with 9 additions and 1 deletions
+6
View File
@@ -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
+1 -1
View File
@@ -282,7 +282,7 @@ class PageImage:
) -> "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(
+2
View File
@@ -40,6 +40,8 @@ class Test(unittest.TestCase):
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)