Summary:
This is one of the fixes needed to support compilation on PyPy 3.6, see https://github.com/pytorch/pytorch/issues/17835
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17836
Differential Revision:
D14399404
Pulled By: soumith
fbshipit-source-id:
ca650a6e2066aed86ddd3314a95d0cb3c515c633
#include <torch/csrc/python_headers.h>
-#if PY_VERSION_HEX < 0x03060100
+// PyPy 3.6 does not yet have PySlice_Unpack
+#if PY_VERSION_HEX < 0x03060100 || defined(PYPY_VERSION)
// PySlice_Unpack not introduced till python 3.6.1
// included here for backwards compatibility