mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V" (b) V is now limited to a simple name (local variable) (c) V is now deleted at the end of the except block
This commit is contained in:
parent
893523e80a
commit
b940e113bf
295 changed files with 817 additions and 743 deletions
|
@ -48,7 +48,7 @@ def _assert(expr, message=None):
|
|||
def play_sound_file(data, rate, ssize, nchannels):
|
||||
try:
|
||||
dsp = ossaudiodev.open('w')
|
||||
except IOError, msg:
|
||||
except IOError as msg:
|
||||
if msg[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY):
|
||||
raise TestSkipped, msg
|
||||
raise TestFailed, msg
|
||||
|
@ -142,7 +142,7 @@ def test_bad_setparameters(dsp):
|
|||
try:
|
||||
result = dsp.setparameters(fmt, channels, rate, True)
|
||||
raise AssertionError("setparameters: expected OSSAudioError")
|
||||
except ossaudiodev.OSSAudioError, err:
|
||||
except ossaudiodev.OSSAudioError as err:
|
||||
print "setparameters: got OSSAudioError as expected"
|
||||
|
||||
def test():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue