Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4902e69

Browse files
committed
More raise statement normalization.
1 parent 6cd2a20 commit 4902e69

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

Demo/scripts/toaiff.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _toaiff(filename, temps):
8080
temps.append(fname)
8181
sts = uncompress.copy(filename, fname)
8282
if sts:
83-
raise error, filename + ': uncompress failed'
83+
raise error(filename + ': uncompress failed')
8484
else:
8585
fname = filename
8686
try:
@@ -93,15 +93,15 @@ def _toaiff(filename, temps):
9393
msg = msg[1]
9494
if type(msg) != type(''):
9595
msg = repr(msg)
96-
raise error, filename + ': ' + msg
96+
raise error(filename + ': ' + msg)
9797
if ftype == 'aiff':
9898
return fname
9999
if ftype is None or not ftype in table:
100-
raise error, '%s: unsupported audio file type %r' % (filename, ftype)
100+
raise error('%s: unsupported audio file type %r' % (filename, ftype))
101101
(fd, temp) = tempfile.mkstemp()
102102
os.close(fd)
103103
temps.append(temp)
104104
sts = table[ftype].copy(fname, temp)
105105
if sts:
106-
raise error, filename + ': conversion to aiff failed'
106+
raise error(filename + ': conversion to aiff failed')
107107
return temp

Lib/UserString.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def __setitem__(self, index, sub):
197197
elif step != 1:
198198
# XXX(twouters): I guess we should be reimplementing
199199
# the extended slice assignment/deletion algorithm here...
200-
raise TypeError, "invalid step in slicing assignment"
200+
raise TypeError("invalid step in slicing assignment")
201201
start = min(start, stop)
202202
self.data = self.data[:start] + sub + self.data[stop:]
203203
else:
@@ -212,7 +212,7 @@ def __delitem__(self, index):
212212
start, stop = stop+1, start+1
213213
elif step != 1:
214214
# XXX(twouters): see same block in __setitem__
215-
raise TypeError, "invalid step in slicing deletion"
215+
raise TypeError("invalid step in slicing deletion")
216216
start = min(start, stop)
217217
self.data = self.data[:start] + self.data[stop:]
218218
else:

Lib/encodings/utf_32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def decode(self, input, errors='strict'):
127127
elif byteorder == 1:
128128
self.decode = codecs.utf_32_be_decode
129129
elif consumed>=4:
130-
raise UnicodeError,"UTF-32 stream does not start with BOM"
130+
raise UnicodeError("UTF-32 stream does not start with BOM")
131131
return (object, consumed)
132132

133133
### encodings module API

Parser/asdl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def t_whitespace(self, s):
103103

104104
def t_default(self, s):
105105
r" . +"
106-
raise ValueError, "unmatched input: %r" % s
106+
raise ValueError("unmatched input: %r" % s)
107107

108108
class ASDLParser(spark.GenericParser, object):
109109
def __init__(self):

0 commit comments

Comments
 (0)