Skip to content

Commit 2f8bc04

Browse files
committed
Move portaudio-binaries submodule
... in order to be able to properly import _sounddevice_data, even on Python 2.x
1 parent e25524c commit 2f8bc04

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "_sounddevice_data"]
2-
path = _sounddevice_data
1+
[submodule "portaudio-binaries"]
2+
path = _sounddevice_data/portaudio-binaries
33
url = https://github.com/spatialaudio/portaudio-binaries.git

_sounddevice_data/__init__.py

Whitespace-only changes.

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@
3333
else:
3434
libname = None
3535

36-
if libname and os.path.isdir('_sounddevice_data'):
36+
if libname and os.path.isdir('_sounddevice_data/portaudio-binaries'):
3737
packages = ['_sounddevice_data']
38-
package_data = {'_sounddevice_data': [libname, 'README.md']}
38+
package_data = {'_sounddevice_data': ['portaudio-binaries/' + libname,
39+
'portaudio-binaries/README.md']}
3940
package_dir['_sounddevice_data'] = '_sounddevice_data'
4041
zip_safe = False
4142
else:

src/sounddevice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
else:
6969
raise
7070
import _sounddevice_data
71-
_lib = _ffi.dlopen(
72-
_os.path.join(next(iter(_sounddevice_data.__path__)), _libname))
71+
_lib = _ffi.dlopen(_os.path.join(next(iter(_sounddevice_data.__path__)),
72+
'portaudio-binaries', _libname))
7373

7474
_sampleformats = {
7575
'float32': _lib.paFloat32,

0 commit comments

Comments
 (0)