summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--decode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/decode.c b/decode.c
index 1b12c9e..a745873 100644
--- a/decode.c
+++ b/decode.c
@@ -22,6 +22,13 @@
#include <stdio.h>
#include <string.h>
+/* Re-define some string functions for Python >= 3.0. */
+#if PY_VERSION_HEX >= 0x03000000
+#define PyString_AsString PyBytes_AsString
+#define PyString_FromString PyBytes_FromString
+#define PyString_Check PyBytes_Check
+#endif
+
/**
* Initialize libsigrokdecode.
*