[pywin32-checkins] pywin32/com/win32comext/directsound/test ds_test.py, 1.6, 1.7
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Mark H. <mha...@us...> - 2009-01-08 03:52:01
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4344/com/win32comext/directsound/test Modified Files: ds_test.py Log Message: py3k-friendly handling of bytes Index: ds_test.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_test.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ds_test.py 26 Nov 2008 08:52:32 -0000 1.6 --- ds_test.py 8 Jan 2009 03:51:47 -0000 1.7 *************** *** 6,9 **** --- 6,10 ---- import win32event, win32api import os + from pywin32_testutil import str2bytes import win32com.directsound.directsound as ds # next two lines are for for debugging: *************** *** 19,26 **** = struct.unpack('<4sl4s4slhhllhh4sl', data) ! if riff != 'RIFF': raise ValueError('invalid wav header') ! if fmtsize != 16 or fmt != 'fmt ' or data != 'data': # fmt chuck is not first chunk, directly followed by data chuck # It is nowhere required that they are, it is just very common --- 20,27 ---- = struct.unpack('<4sl4s4slhhllhh4sl', data) ! if riff != str2bytes('RIFF'): raise ValueError('invalid wav header') ! if fmtsize != 16 or fmt != str2bytes('fmt ') or str2bytes(data) != 'data': # fmt chuck is not first chunk, directly followed by data chuck # It is nowhere required that they are, it is just very common |