1 /* 2 A* ------------------------------------------------------------------- 3 B* This file contains source code for the PyMOL computer program 4 C* copyright 1998-2000 by Warren Lyford Delano of DeLano Scientific. 5 D* ------------------------------------------------------------------- 6 E* It is unlawful to modify or remove this copyright notice. 7 F* ------------------------------------------------------------------- 8 G* Please see the accompanying LICENSE file for further information. 9 H* ------------------------------------------------------------------- 10 I* Additional authors of this source file include: 11 -* 12 -* 13 -* 14 Z* ------------------------------------------------------------------- 15 */ 16 #ifndef _H_os_python 17 #define _H_os_python 18 19 #include"Python.h" 20 21 #if PY_MAJOR_VERSION >= 3 22 # define PyInt_Check PyLong_Check 23 # define PyInt_FromLong PyLong_FromLong 24 # define PyInt_AsLong PyLong_AsLong 25 # define PyInt_AS_LONG PyLong_AS_LONG 26 27 # define PyNumber_Int PyNumber_Long 28 29 # define PyString_Check PyUnicode_Check 30 # define PyString_Size PyUnicode_GetLength 31 # define PyString_FromString PyUnicode_FromString 32 # define PyString_FromStringAndSize PyUnicode_FromStringAndSize 33 # define PyString_InternFromString PyUnicode_InternFromString 34 # define PyString_AsString PyUnicode_AsUTF8 35 # define PyString_AS_STRING PyUnicode_AsUTF8 36 37 # define PyCObject_AsVoidPtr(capsule) PyCapsule_GetPointer(capsule, NULL) 38 # define PyCObject_FromVoidPtr(p, d) Error_Function_not_available_PyCapsule_New_destructor_differs() 39 # define PyCObject_Check PyCapsule_CheckExact 40 41 # define PyEval_EvalCode(o, ...) PyEval_EvalCode((PyObject*)o, __VA_ARGS__) 42 #endif 43 44 #endif 45 46 47 48