Skip to content

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

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

# 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.

return os.readlink(sys_path)
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