In article <mailman.2736.1266522979.28905.python-l...@python.org>, Wes James <compte...@gmail.com> 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 (a...@pythoncraft.com) <*> 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