Skip to content

Commit 2633722

Browse files
committed
Merge pull request #7392 from dstephens99/OptionTests
TST: Changed the error raised by no tables in data.Options
2 parents 8633e6f + 5930bcc commit 2633722

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/io/data.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,9 @@ def _get_option_data(self, month, year, expiry, table_loc, name):
664664
"element".format(url))
665665
tables = root.xpath('.//table')
666666
ntables = len(tables)
667-
if table_loc - 1 > ntables:
667+
if ntables == 0:
668+
raise RemoteDataError("No tables found at {0!r}".format(url))
669+
elif table_loc - 1 > ntables:
668670
raise IndexError("Table location {0} invalid, {1} tables"
669671
" found".format(table_loc, ntables))
670672

0 commit comments

Comments
 (0)