Fix PySlice_Unpack not available on PyPy 3.6 yet (#17836)

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
This commit is contained in:
Konstantin Lopuhin 2019-03-09 20:06:57 -08:00 committed by Facebook Github Bot
parent 742568e7eb
commit 320c6977c2

View File

@ -2,7 +2,8 @@
#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