In article <[email protected]>, Wes James <[email protected]> wrote: > > try: > if value=3D=3D'[]' or value=3D=3D'': > value=3D[] > else: > no_brackets =3D value[1:-1] # s.strip(' \t[]') > c =3D csv.reader([no_brackets], quotechar=3D"'") > value=3Dc.next() > return (value, None) > except: > return (value, self.error_message)
Two important points: * Don't use bare except: clauses * Put less code in the try: clause to make it easier to track down problems -- Aahz ([email protected]) <*> http://www.pythoncraft.com/ "At Resolver we've found it useful to short-circuit any doubt and just refer to comments in code as 'lies'. :-)" -- http://mail.python.org/mailman/listinfo/python-list
