Disable pylint print statement flag + fix venv detection#954
Merged
MikhailArkhipov merged 112 commits intomicrosoft:masterfrom Mar 6, 2018
MikhailArkhipov:master
Merged
Disable pylint print statement flag + fix venv detection#954MikhailArkhipov merged 112 commits intomicrosoft:masterfrom MikhailArkhipov:master
MikhailArkhipov merged 112 commits intomicrosoft:masterfrom
MikhailArkhipov:master
Conversation
added 30 commits
December 1, 2017 10:18
added 14 commits
February 28, 2018 22:19
brettcannon
approved these changes
Mar 5, 2018
| const output = await this.processService.exec(pythonPath, ['-c', 'import sys;print(hasattr(sys, "real_prefix"))']); | ||
| // hasattr(sys, 'real_prefix') works for virtualenv while | ||
| // '(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))' works for venv | ||
| const code = 'import sys\nif hasattr(sys, "real_prefix"):\n print("virtualenv")\nif hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix:\n print("venv")'; |
Member
There was a problem hiding this comment.
Should that be an elif for the second clause?
Author
There was a problem hiding this comment.
Prob doesn't matter, first won't be executed if the second is true I assume.
Member
There was a problem hiding this comment.
Better safe than sorry, so I just made the change directly in the PR. 😄
DonJayamanne
approved these changes
Mar 5, 2018
| // hasattr(sys, 'real_prefix') works for virtualenv while | ||
| // '(hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix))' works for venv | ||
| const code = 'import sys\nif hasattr(sys, "real_prefix"):\n print("virtualenv")\nif hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix:\n print("venv")'; | ||
| const output = await this.processService.exec(pythonPath, ['-c', code]); |
Codecov Report
@@ Coverage Diff @@
## master #954 +/- ##
==========================================
- Coverage 64.01% 64.01% -0.01%
==========================================
Files 260 260
Lines 12028 12027 -1
Branches 2131 2130 -1
==========================================
- Hits 7700 7699 -1
Misses 4319 4319
Partials 9 9
Continue to review full report at Codecov.
|
DonJayamanne
approved these changes
Mar 5, 2018
brettcannon
added a commit
to brettcannon/vscode-python
that referenced
this pull request
Mar 7, 2018
Due to a bug in Pylint where specifying `E` as enabled checks flips on `--py3k`, we need to explicitly list all `E` checkers to explicitly avoid (at least) print-statement which throws false-positives for folks not porting to Python 3. Closes microsoft#722 by partially reverting microsoft#954
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #722
Properly detects venv
Added tests