@@ -579,7 +579,8 @@ def _clean_options(self, options, engine):
579
579
580
580
# type conversion-related
581
581
if converters is not None :
582
- assert (isinstance (converters , dict ))
582
+ if not (isinstance (converters , dict )):
583
+ raise AssertionError ()
583
584
else :
584
585
converters = {}
585
586
@@ -1474,7 +1475,8 @@ def _rows_to_cols(self, content):
1474
1475
if self ._implicit_index :
1475
1476
col_len += len (self .index_col )
1476
1477
1477
- assert (self .skip_footer >= 0 )
1478
+ if not ((self .skip_footer >= 0 )):
1479
+ raise AssertionError ()
1478
1480
1479
1481
if col_len != zip_len and self .index_col is not False :
1480
1482
row_num = - 1
@@ -1768,12 +1770,15 @@ def __init__(self, f, colspecs, filler, thousands=None):
1768
1770
self .filler = filler # Empty characters between fields.
1769
1771
self .thousands = thousands
1770
1772
1771
- assert isinstance (colspecs , (tuple , list ))
1773
+ if not ( isinstance (colspecs , (tuple , list ))):
1774
+ raise AssertionError ()
1775
+
1772
1776
for colspec in colspecs :
1773
- assert isinstance (colspec , (tuple , list ))
1774
- assert len (colspec ) == 2
1775
- assert isinstance (colspec [0 ], int )
1776
- assert isinstance (colspec [1 ], int )
1777
+ if not ( isinstance (colspec , (tuple , list )) and
1778
+ len (colspec ) == 2 and
1779
+ isinstance (colspec [0 ], int ) and
1780
+ isinstance (colspec [1 ], int ) ):
1781
+ raise AssertionError ()
1777
1782
1778
1783
def next (self ):
1779
1784
line = next (self .f )
0 commit comments