Remove (most) Python 2 support from C++ code#35614
Closed
dreiss wants to merge 8 commits intogh/dreiss/31/basefrom
Closed
Remove (most) Python 2 support from C++ code#35614dreiss wants to merge 8 commits intogh/dreiss/31/basefrom
dreiss wants to merge 8 commits intogh/dreiss/31/basefrom
Conversation
💊 CI failures summary and remediationsAs of commit 6b5557e (more details on the Dr. CI page):
Extra GitHub checks: 2 failed
ci.pytorch.org: 1 failedThis comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 49 times. |
This was referenced Mar 28, 2020
Closed
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876)
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876)
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876) [ghstack-poisoned]
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876) [ghstack-poisoned]
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876) [ghstack-poisoned]
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876)
gchanan
reviewed
May 13, 2020
| // RPC module is only avaialble for Python3 | ||
| // when build flag "USE_DISTRIBUTED" is on. | ||
| !py::module::import("torch._six").attr("PY2").cast<bool>() && | ||
| // RPC module is only avaialble when build flag "USE_DISTRIBUTED" is on. |
Contributor
Author
There was a problem hiding this comment.
Found this while grepping for PY2 as part of for #35615 .
gchanan
approved these changes
May 13, 2020
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876)
Summary: 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](https://our.internmc.facebook.com/intern/diff/D20842876)
Contributor
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack from ghstack:
Summary:
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