diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-03 05:37:26 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-02-03 05:37:26 (GMT) |
| commit | dde5b94875460e704099593766f4a5bc3279483d (patch) | |
| tree | d0c369148bd2d2f723896839aada008ef931ff19 /Lib/test/test_ossaudiodev.py | |
| parent | 17ae2ba78f96d661bdd1d8e2e8f96016c4aa4a60 (diff) | |
| download | cpython-dde5b94875460e704099593766f4a5bc3279483d.zip cpython-dde5b94875460e704099593766f4a5bc3279483d.tar.gz cpython-dde5b94875460e704099593766f4a5bc3279483d.tar.bz2 | |
#7092: Silence more py3k warnings. Patch by Florent Xicluna.
Diffstat (limited to 'Lib/test/test_ossaudiodev.py')
| -rw-r--r-- | Lib/test/test_ossaudiodev.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_ossaudiodev.py b/Lib/test/test_ossaudiodev.py index df04705..6de4671 100644 --- a/Lib/test/test_ossaudiodev.py +++ b/Lib/test/test_ossaudiodev.py @@ -45,7 +45,8 @@ class OSSAudioDevTests(unittest.TestCase): try: dsp = ossaudiodev.open('w') except IOError, msg: - if msg[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY): + if msg.args[0] in (errno.EACCES, errno.ENOENT, + errno.ENODEV, errno.EBUSY): raise unittest.SkipTest(msg) raise @@ -71,7 +72,7 @@ class OSSAudioDevTests(unittest.TestCase): self.fail("dsp.%s not read-only" % attr) # Compute expected running time of sound sample (in seconds). - expected_time = float(len(data)) / (ssize/8) / nchannels / rate + expected_time = float(len(data)) / (ssize//8) / nchannels / rate # set parameters based on .au file headers dsp.setparameters(AFMT_S16_NE, nchannels, rate) @@ -162,7 +163,8 @@ def test_main(): try: dsp = ossaudiodev.open('w') except (ossaudiodev.error, IOError), msg: - if msg[0] in (errno.EACCES, errno.ENOENT, errno.ENODEV, errno.EBUSY): + if msg.args[0] in (errno.EACCES, errno.ENOENT, + errno.ENODEV, errno.EBUSY): raise unittest.SkipTest(msg) raise dsp.close() |
