diff options
Diffstat (limited to 'Lib/packaging/pypi')
-rw-r--r-- | Lib/packaging/pypi/dist.py | 6 | ||||
-rw-r--r-- | Lib/packaging/pypi/simple.py | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Lib/packaging/pypi/dist.py b/Lib/packaging/pypi/dist.py index db04cdaa70..d3824c22e8 100644 --- a/Lib/packaging/pypi/dist.py +++ b/Lib/packaging/pypi/dist.py @@ -256,7 +256,7 @@ class DistInfo(IndexReference): hashlib.new(hashname) except ValueError: raise UnsupportedHashName(hashname) - if not url in [u['url'] for u in self.urls]: + if url not in [u['url'] for u in self.urls]: self.urls.append({ 'url': url, 'hashname': hashname, @@ -329,7 +329,7 @@ class DistInfo(IndexReference): url param""" hashname = self.url['hashname'] expected_hashval = self.url['hashval'] - if not None in (expected_hashval, hashname): + if None not in (expected_hashval, hashname): with open(filename, 'rb') as f: hashval = hashlib.new(hashname) hashval.update(f.read()) @@ -409,7 +409,7 @@ class ReleasesList(IndexReference): (release.name, self.name)) version = str(release.version) - if not version in self.get_versions(): + if version not in self.get_versions(): # append only if not already exists self.releases.append(release) for dist in release.dists.values(): diff --git a/Lib/packaging/pypi/simple.py b/Lib/packaging/pypi/simple.py index c372c6fe3e..1dcb8ce43a 100644 --- a/Lib/packaging/pypi/simple.py +++ b/Lib/packaging/pypi/simple.py @@ -231,7 +231,8 @@ class Crawler(BaseClient): """ self._mirrors_used.add(self.index_url) index_url = self._mirrors.pop() - if not ("http://" or "https://" or "file://") in index_url: + # XXX use urllib.parse for a real check of missing scheme part + if not index_url.startswith(("http://", "https://", "file://")): index_url = "http://%s" % index_url if not index_url.endswith("/simple"): @@ -282,7 +283,7 @@ class Crawler(BaseClient): name = release.name else: name = release_info['name'] - if not name.lower() in self._projects: + if name.lower() not in self._projects: self._projects[name.lower()] = ReleasesList(name, index=self._index) if release: @@ -320,7 +321,7 @@ class Crawler(BaseClient): # it's a distribution, so create a dist object try: infos = get_infos_from_url(link, project_name, - is_external=not self.index_url in url) + is_external=self.index_url not in url) except CantParseArchiveName as e: if self.verbose: logger.warning( |