Fix python2 and python 3 compatibility found by lint.#13140
Closed
Yangqing wants to merge 2 commits intopytorch:masterfrom
Closed
Fix python2 and python 3 compatibility found by lint.#13140Yangqing wants to merge 2 commits intopytorch:masterfrom
Yangqing wants to merge 2 commits intopytorch:masterfrom
Conversation
added 2 commits
October 25, 2018 14:08
Summary: This is an example diff to show what lint rules are being applied. Differential Revision: D10858478 fbshipit-source-id: fc405fc76c44aca031a7720ebccd649993d356b7
Summary: This is an example about the benefit of proper facebook linter. The old code was not python 2.x (actually, pre-python 3.3) compatible. Note that FileExistsError is added in Python 3.3: https://stackoverflow.com/questions/20790580/python-specifically-handle-file-exists-exception Differential Revision: D10858804 fbshipit-source-id: 7ab6bccdd6e22e8014004748c250ceb74eafdd95
colesbury
reviewed
Oct 25, 2018
| @@ -0,0 +1 @@ | |||
| from __future__ import absolute_import, division, print_function, unicode_literals | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Pull Request resolved: pytorch#13140 This is an example about the benefit of proper facebook linter. The old code was not python 2.x (actually, pre-python 3.3) compatible. Note that FileExistsError is added in Python 3.3: https://stackoverflow.com/questions/20790580/python-specifically-handle-file-exists-exception Reviewed By: mingzhe09088 Differential Revision: D10858804 fbshipit-source-id: a4c995aef9f720cb8b0ce463f0a51db667fc42f2
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.
Summary:
This is an example about the benefit of proper facebook linter. The old code
was not python 2.x (actually, pre-python 3.3) compatible. Note that FileExistsError
is added in Python 3.3:
https://stackoverflow.com/questions/20790580/python-specifically-handle-file-exists-exception
Differential Revision: D10858804