From ce36ad8a467d914eb5c91f33835b9eaea18ee93b Mon Sep 17 00:00:00 2001 From: Collin Winter Date: Thu, 30 Aug 2007 01:19:48 +0000 Subject: Raise statement normalization in Lib/. --- Lib/csv.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Lib/csv.py') diff --git a/Lib/csv.py b/Lib/csv.py index cd0f7d34bae..32a377e8f04 100644 --- a/Lib/csv.py +++ b/Lib/csv.py @@ -104,9 +104,8 @@ class DictWriter: self.fieldnames = fieldnames # list of keys for the dict self.restval = restval # for writing short dicts if extrasaction.lower() not in ("raise", "ignore"): - raise ValueError, \ - ("extrasaction (%s) must be 'raise' or 'ignore'" % - extrasaction) + raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'" + % extrasaction) self.extrasaction = extrasaction self.writer = writer(f, dialect, *args, **kwds) @@ -114,8 +113,8 @@ class DictWriter: if self.extrasaction == "raise": wrong_fields = [k for k in rowdict if k not in self.fieldnames] if wrong_fields: - raise ValueError("dict contains fields not in fieldnames: " + - ", ".join(wrong_fields)) + raise ValueError("dict contains fields not in fieldnames: " + + ", ".join(wrong_fields)) return [rowdict.get(key, self.restval) for key in self.fieldnames] def writerow(self, rowdict): @@ -155,7 +154,7 @@ class Sniffer: delimiters) if not delimiter: - raise Error, "Could not determine delimiter" + raise Error("Could not determine delimiter") class dialect(Dialect): _name = "sniffed" -- cgit v1.2.3