Commit b80ecbf0 authored by Gregory Lee's avatar Gregory Lee
Browse files

Fix errors related to missing PyInt_AsLong and PyString_AsString on Python 3

use _PyUnicode_AsString for Python 3.0-3.2
parent 4d6be94b
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
=========================================================================*/ =========================================================================*/
#include "vtkPython.h" // must be the first thing that's included. #include "vtkPython.h" // must be the first thing that's included.
#include "vtkPythonCompatibility.h"
#include "vtkMatplotlibMathTextUtilities.h" #include "vtkMatplotlibMathTextUtilities.h"
#include "vtkCommand.h" #include "vtkCommand.h"
......
...@@ -49,6 +49,9 @@ ...@@ -49,6 +49,9 @@
#define PyUnicode_DecodeLocaleAndSize PyUnicode_DecodeFSDefaultAndSize #define PyUnicode_DecodeLocaleAndSize PyUnicode_DecodeFSDefaultAndSize
#define PyUnicode_DecodeLocale PyUnicode_DecodeFSDefault #define PyUnicode_DecodeLocale PyUnicode_DecodeFSDefault
#define PyUnicode_EncodeLocale(o,e) PyUnicode_EncodeFSDefault(o) #define PyUnicode_EncodeLocale(o,e) PyUnicode_EncodeFSDefault(o)
#define PyString_AsString _PyUnicode_AsString
#else
#define PyString_AsString PyUnicode_AsUTF8
#endif #endif
// Buffer compatibility // Buffer compatibility
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment