| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…l but are not marked as such
There was a problem hiding this comment.
The change looks correct. The code already handles the None case, so it's not an issue in reality. Nevertheless good to change it.
Just to satisfy the typing, could you adjust the abspath call a few lines below?
Lines 1923 to 1925 in 517f5ae
if options.custom_typeshed_dir:
- options.abs_custom_typeshed_dir = os.path.abspath(args.custom_typeshed_dir)
+ options.abs_custom_typeshed_dir = os.path.abspath(options.custom_typeshed_dir)
Sorry, something went wrong.
|
@cdce8p just saw your comment right after I pushed a change to resolve the type error. Instead of making the change you suggested, I changed the if condition to check if args.custom_typeshed_dir is truthy. I believe they are equivalent, but do you have a preference? |
Sorry, something went wrong.
|
I would suggest to use the value from options. That better matches what we do for other values too. Directly below for mypy_config_file. We assign it to options.config_file and just use that afterwards. Lines 1926 to 1929 in 517f5ae |
Sorry, something went wrong.
…to os.path.abspath
|
@cdce8p Makes sense, thanks. Made the change you suggested. |
Sorry, something went wrong.
|
Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Hello mypy team,
I am working as part of a research team developing a code analysis tool for Python. One of the issues the tool discovered in mypy's codebase is that two fields in the _Arguments class, mypy_config_file and custom_typeshed_dir, can take on a None value, but they are not marked as such. Calling stubtest.parse_options on an empty list of arguments reproduces the situation where these two fields are None.
If you are interested in learning more about the tool and how it found this issue, let me know down in the comments, or you can contact me at xifaras.s@northeastern.edu. If you find that this issue is not legitimate, I would be interested in understanding why.
Note that I did not add any test cases as no functional changes to the code were made.
Thank you for your consideration!
-Sam