Skip to content

Commit 560e4ae

Browse files
fixed 2.7 compiler error.
Signed-off-by: David Rebbe <drebbe@intrepidcs.com>
1 parent 9b07543 commit 560e4ae

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

include/defines.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
#define PyUniStr_AsStrOrUTF8(obj) (char*)PyUnicode_AsUTF8(obj)
1616
#elif (PY_MAJOR_VERSION >= 3)
1717
#define PyUniStr_AsStrOrUTF8(obj) PyUnicode_AsUTF8(obj)
18+
#elif (PY_MAJOR_VERSION == 2)
19+
#define PyUniStr_AsStrOrUTF8(obj) PyString_AsString(obj)
1820
#else
19-
#define PyStrOrUni_AsStrOrUTF8(obj) PyString_AsString(obj)
21+
#error Failed to suppport PyUnicode_AsUTF8
2022
#endif
2123

2224
// Enable use of generic device settings object in 803 or newer.

0 commit comments

Comments
 (0)