Skip to content

Commit

Permalink
Fix for the fact that some versions of the csv module (apparently
Browse files Browse the repository at this point in the history
including some bundled with pypy) misspell the word "larger" as
"larget". This fixes one pypy test failure mentioned in wireserviceGH-165.
  • Loading branch information
msabramo committed May 12, 2012
1 parent 5e3b271 commit 1ad45af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion csvkit/unicsv.py
Expand Up @@ -6,6 +6,7 @@

import codecs
import csv
import fnmatch
from cStringIO import StringIO

from csvkit.exceptions import FieldSizeLimitError
Expand Down Expand Up @@ -40,7 +41,7 @@ def next(self):
row = self.reader.next()
except csv.Error, e:
# Terrible way to test for this exception, but there is no subclass
if 'field larger than field limit' in str(e):
if fnmatch.fnmatch(str(e), 'field large[rt] than field limit *'):
raise FieldSizeLimitError(csv.field_size_limit())
else:
raise e
Expand Down

0 comments on commit 1ad45af

Please sign in to comment.