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 TfPyBytes_Check PyBytes_Check
45 #define TfPyString_Check(a) (PyBytes_Check(a) || PyUnicode_Check(a))
46 #define TfPyString_AsString PyUnicode_AsUTF8
49 #define TfPyInt_Check PyLong_Check
51 #define TfPyInt_AS_LONG PyLong_AsLong
54 #define TfPyIteratorNextMethodName "__next__"
55 #define TfPyClassMethodFuncName "__func__"
56 #define TfPyBoolBuiltinFuncName "__bool__"
57 #define TfPyBuiltinModuleName "builtins"
61 #define TfPy_TPFLAGS_HAVE_NEWBUFFER Py_TPFLAGS_HAVE_NEWBUFFER
62 #define TfPy_TPFLAGS_HAVE_GETCHARBUFFER Py_TPFLAGS_HAVE_GETCHARBUFFER
64 #define TfPyBytes_Check PyString_Check
65 #define TfPyString_Check PyString_Check
66 #define TfPyString_AsString PyString_AsString
68 #define TfPyInt_Check PyInt_Check
69 #define TfPyInt_AS_LONG PyInt_AS_LONG
71 #define TfPyIteratorNextMethodName "next"
72 #define TfPyClassMethodFuncName "im_func"
73 #define TfPyBoolBuiltinFuncName "__nonzero__"
74 #define TfPyBuiltinModuleName "__builtin__"
80 #endif // PXR_BASE_TF_PY_3_COMPAT_H
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE