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
diff --git a/Lib/test/test_linuxaudiodev.py b/Lib/test/test_linuxaudiodev.py
index fe902b5..05e4041 100644
--- a/Lib/test/test_linuxaudiodev.py
+++ b/Lib/test/test_linuxaudiodev.py
@@ -27,7 +27,7 @@
try:
a = linuxaudiodev.open('w')
- except linuxaudiodev.error, msg:
+ except linuxaudiodev.error as msg:
if msg[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY):
raise TestSkipped, msg
raise TestFailed, msg
@@ -62,27 +62,27 @@
nchannels = 1
try:
a.setparameters(-1, size, nchannels, fmt)
- except ValueError, msg:
+ except ValueError as msg:
print msg
try:
a.setparameters(rate, -2, nchannels, fmt)
- except ValueError, msg:
+ except ValueError as msg:
print msg
try:
a.setparameters(rate, size, 3, fmt)
- except ValueError, msg:
+ except ValueError as msg:
print msg
try:
a.setparameters(rate, size, nchannels, 177)
- except ValueError, msg:
+ except ValueError as msg:
print msg
try:
a.setparameters(rate, size, nchannels, linuxaudiodev.AFMT_U16_LE)
- except ValueError, msg:
+ except ValueError as msg:
print msg
try:
a.setparameters(rate, 16, nchannels, fmt)
- except ValueError, msg:
+ except ValueError as msg:
print msg
def test():