Better error message for invalid package names passed to mypy#3447
Merged
gvanrossum merged 2 commits intopython:masterfrom May 26, 2017
Merged
Conversation
Revert accidental change
gvanrossum
reviewed
May 25, 2017
mypy/main.py
Outdated
| targets.append(BuildSource(f, crawl_up(f)[1], None)) | ||
| try: | ||
| targets.append(BuildSource(f, crawl_up(f)[1], None)) | ||
| except ValueError as e: |
Member
There was a problem hiding this comment.
Can you change this to catch the ValueError only from crawl_up(f)? It would be even better if the latter function returned a special result (maybe None) or (even more better :-) raised a dedicated exception, instead of essentially crashing with ValueError. Ditto for expand_dir(f) below (though there at least the scope of the except clause is sufficiently limited).
Contributor
Author
|
@gvanrossum Thank you for the review! I have added an InvalidPackageName exception. |
Member
|
Thanks for the PR! It's merged now. |
carljm
added a commit
to carljm/mypy
that referenced
this pull request
May 30, 2017
* master: (23 commits) Make return type of open() more precise (python#3477) Add test cases that delete a file during incremental checking (python#3461) Parse each format-string component separately (python#3390) Don't warn about returning Any if it is a proper subtype of the return type (python#3473) Add __setattr__ support (python#3451) Remove bundled lib-typing (python#3337) Move version of extensions to post-release (python#3348) Fix None slice bounds with strict-optional (python#3445) Allow NewType subclassing NewType. (python#3465) Add console scripts (python#3074) Fix 'variance' label. Change label for variance section to just 'variance' (python#3429) Better error message for invalid package names passed to mypy (python#3447) Fix last character cut in html-report if file does not end with newline (python#3466) Print pytest output as it happens (python#3463) Add mypy roadmap (python#3460) Add flag to avoid interpreting arguments with a default of None as Optional (python#3248) Add type checking plugin support for functions (python#3299) Mismatch of inferred type and return type note (python#3428) Sync typeshed (python#3449) ...
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.
Addresses issue #2775