24 #ifndef PXR_BASE_TF_PY_3_COMPAT_H
25 #define PXR_BASE_TF_PY_3_COMPAT_H
37 #if PY_MAJOR_VERSION >= 3
41 #define TfPy_TPFLAGS_HAVE_NEWBUFFER 0
42 #define TfPy_TPFLAGS_HAVE_GETCHARBUFFER 0
44 #define TfPyString_Check(a) (PyBytes_Check(a) || PyUnicode_Check(a))
45 #define TfPyString_AsString PyUnicode_AsUTF8
48 #define TfPyInt_Check PyLong_Check
50 #define TfPyInt_AS_LONG PyLong_AsLong
53 #define TfPyIteratorNextMethodName "__next__"
54 #define TfPyClassMethodFuncName "__func__"
55 #define TfPyBoolBuiltinFuncName "__bool__"
56 #define TfPyBuiltinModuleName "builtins"
60 #define TfPy_TPFLAGS_HAVE_NEWBUFFER Py_TPFLAGS_HAVE_NEWBUFFER
61 #define TfPy_TPFLAGS_HAVE_GETCHARBUFFER Py_TPFLAGS_HAVE_GETCHARBUFFER
63 #define TfPyInt_Check PyInt_Check
64 #define TfPyInt_AS_LONG PyInt_AS_LONG
66 #define TfPyIteratorNextMethodName "next"
67 #define TfPyClassMethodFuncName "im_func"
68 #define TfPyBoolBuiltinFuncName "__nonzero__"
69 #define TfPyBuiltinModuleName "__builtin__"
71 #define TfPyString_AsString PyString_AsString
72 #define TfPyString_Check PyString_Check
78 #endif // PXR_BASE_TF_PY_3_COMPAT_H
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE