aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/csv.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-08-30 01:19:48 +0000
committerCollin Winter <collinw@gmail.com>2007-08-30 01:19:48 +0000
commitce36ad8a467d914eb5c91f33835b9eaea18ee93b (patch)
tree05bf654f3359e20b455dc300bd860bba5d291c8d /Lib/csv.py
parent8b3febef2f96c35e9aad9db2ef499db040fdefae (diff)
downloadcpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.gz
cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.zip
Raise statement normalization in Lib/.
Diffstat (limited to 'Lib/csv.py')
-rw-r--r--Lib/csv.py11
1 files changed, 5 insertions, 6 deletions
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"