From ca8dbcf9bea46607d22fe205498b4c071c705860 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 4 Oct 2019 23:23:43 +0200 Subject: Refs #108 - Test and improve format autodetection Autodetection was added for the odf format. --- tablib/formats/_dbf.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'tablib/formats/_dbf.py') diff --git a/tablib/formats/_dbf.py b/tablib/formats/_dbf.py index 710797d..0d1c87b 100644 --- a/tablib/formats/_dbf.py +++ b/tablib/formats/_dbf.py @@ -83,9 +83,5 @@ def detect(stream): else: _dbf = dbf.Dbf(StringIO(stream), readOnly=True) return True - except (ValueError, struct.error): - # When we try to open up a file that's not a DBF, dbfpy raises a - # ValueError. - # When unpacking a string argument with less than 8 chars, struct.error is - # raised. + except Exception: return False -- cgit v1.2.1