From 641d6008b666e509d1a394846e2ea5348fa157d4 Mon Sep 17 00:00:00 2001 From: Stephen Sinclair Date: Mon, 13 Jan 2020 18:23:48 +0100 Subject: [PATCH] PyRtAudio: Fix a strange retro-bug due to import print_function. --- contrib/python/pyrtaudio/rtaudiomodule.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/python/pyrtaudio/rtaudiomodule.cpp b/contrib/python/pyrtaudio/rtaudiomodule.cpp index bc6f4b7..80df321 100644 --- a/contrib/python/pyrtaudio/rtaudiomodule.cpp +++ b/contrib/python/pyrtaudio/rtaudiomodule.cpp @@ -40,7 +40,12 @@ extern "C" { typedef struct { - PyObject_HEAD; + PyObject_HEAD +#if PY_MAJOR_VERSION < 3 + void *padding; // python 2.7 seems to set dac to bad value + // after print_function, causing a crash, no + // idea why, but this fixes it. +#endif RtAudio *dac; RtAudioFormat _format; int _bufferSize;