mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35614 Python 2 has reached end-of-life and is no longer supported by PyTorch. Now we can clean up a lot of cruft that we put in place to support it. These changes were all done manually, and I skipped anything that seemed like it would take more than a few seconds, so I think it makes sense to review it manually as well. Test Plan: CI Differential Revision: D20842876 Pulled By: dreiss fbshipit-source-id: 18abf0d324ed2185ec6d27c864e935d856dcc6ad
20 lines
487 B
C
20 lines
487 B
C
#pragma once
|
|
|
|
// workaround for Python 2 issue: https://bugs.python.org/issue17120
|
|
// NOTE: It looks like this affects Python 3 as well.
|
|
#pragma push_macro("_XOPEN_SOURCE")
|
|
#pragma push_macro("_POSIX_C_SOURCE")
|
|
#undef _XOPEN_SOURCE
|
|
#undef _POSIX_C_SOURCE
|
|
|
|
#include <Python.h>
|
|
#include <structseq.h>
|
|
|
|
#pragma pop_macro("_XOPEN_SOURCE")
|
|
#pragma pop_macro("_POSIX_C_SOURCE")
|
|
|
|
#if PY_MAJOR_VERSION < 3
|
|
#error "Python 2 has reached end-of-life and is no longer supported by PyTorch."
|
|
#endif
|
|
|