Skip to content

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

Merged
merged 10 commits into from
Aug 4, 2019
Merged

typing fixes #334

merged 10 commits into from
Aug 4, 2019

Conversation

willmcgugan
Copy link
Member

@willmcgugan willmcgugan commented Aug 4, 2019

Type of changes

  • Bug fix
  • New feature
  • Documentation / docstrings
  • Tests
  • Other

Checklist

  • I've run the latest black with default args on new code.
  • I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • I've added tests for new code.
  • I accept that @willmcgugan may be pedantic in the code review.

Description

Fixing typing related issues

@@ -11,7 +11,7 @@
from os import fspath
except ImportError:

def fspath(path):
def fspath(path): # type: ignore
Copy link
Member Author

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
Copy link
Member Author

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)))
Copy link
Member Author

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.

@coveralls
Copy link

coveralls commented Aug 4, 2019

Coverage Status

Coverage increased (+0.0002%) to 99.001% when pulling 4a2bece on typing-fixes into 7d7539a on master.

@willmcgugan willmcgugan merged commit 84719be into master Aug 4, 2019
@althonos althonos deleted the typing-fixes branch October 13, 2020 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants