-
-
Notifications
You must be signed in to change notification settings - Fork 177
typing fixes #334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typing fixes #334
Conversation
@@ -11,7 +11,7 @@ | |||
from os import fspath | |||
except ImportError: | |||
|
|||
def fspath(path): | |||
def fspath(path): # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mypy complains about redefinition
@@ -342,7 +342,8 @@ def _get_dir_entry(self, dir_path): | |||
|
|||
def close(self): | |||
# type: () -> None | |||
self.root = None | |||
if not self._closed: | |||
del self.root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mypy complains when assigning None, rather than modify the type of root
just del it.
else: | ||
target = os.readlink(fsencode(sys_path)) | ||
return fsdecode(os.readlink(fsencode(sys_path))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link target was returned as bytes
. A genuine bug uncovered by Mypy. Thanks, Mypy.
Type of changes
Checklist
Description
Fixing typing related issues