Address a couple strict_optional lines in req/req_install.py.

This commit is contained in:
Chris Jerdonek 2019-07-03 15:27:56 -07:00
parent 2b58bcde31
commit 0baec60bdc
1 changed files with 4 additions and 4 deletions

View File

@ -83,10 +83,10 @@ class InstallRequirement(object):
self.req = req
self.comes_from = comes_from
self.constraint = constraint
if source_dir is not None:
self.source_dir = os.path.normpath(os.path.abspath(source_dir))
if source_dir is None:
self.source_dir = None # type: Optional[str]
else:
self.source_dir = None
self.source_dir = os.path.normpath(os.path.abspath(source_dir))
self.editable = editable
self._wheel_cache = wheel_cache
@ -169,7 +169,7 @@ class InstallRequirement(object):
s += ' in %s' % display_path(self.satisfied_by.location)
if self.comes_from:
if isinstance(self.comes_from, six.string_types):
comes_from = self.comes_from
comes_from = self.comes_from # type: Optional[str]
else:
comes_from = self.comes_from.from_path()
if comes_from: