Project

General

Profile

« Previous | Next » 

Revision 5430

csvs.py: Modify csv.Dialect._validate() to ignore "delimiter must be a 1-character string" errors, in order to support multi-char delimiters used by TsvReader

View differences:

lib/csvs.py
89 89
csv.Dialect.__eq__ = lambda self, other: self.__dict__ == other.__dict__
90 90
csv.Dialect.__ne__ = lambda self, other: not (self == other)
91 91

  
92
__Dialect__validate_orig = csv.Dialect._validate
93
def __Dialect__validate(self):
94
        try: __Dialect__validate_orig(self)
95
        except _csv.Error, e:
96
            if str(e) == '"delimiter" must be an 1-character string': pass # OK
97
            else: raise
98
csv.Dialect._validate = __Dialect__validate
99

  
92 100
##### Row filters
93 101

  
94 102
class Filter:

Also available in: Unified diff