Skip to content

Commit d2e65dd

Browse files
committed
Fix py2/py3 comp
1 parent 0222439 commit d2e65dd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

html_table_extractor/extractor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ def __init__(self, table, id_=None, **kwargs):
1212
# input is Tag
1313
if isinstance(table, Tag):
1414
self._table = table.find(id=id_)
15-
# input is str/unicode
16-
elif isinstance(table, str) or isinstance(table, unicode):
15+
# input is str
16+
# for py2, make sure you pass in str
17+
# for py3, everything is str by default
18+
elif isinstance(table, str):
1719
self._table = BeautifulSoup(table, 'html.parser').find(id=id_)
1820
else:
1921
raise Exception('unrecognized type')

0 commit comments

Comments
 (0)