From: Éric Araujo Date: Wed, 8 Jun 2011 02:31:18 +0000 (+0200) Subject: Fix misunderstanding of how booleans work X-Git-Tag: v3.3.0a1~2153^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ea888e038b7c5da136ef90191c16cf5ac6de4b14;p=thirdparty%2FPython%2Fcpython.git Fix misunderstanding of how booleans work --- diff --git a/Lib/packaging/pypi/simple.py b/Lib/packaging/pypi/simple.py index c372c6fe3ef7..777fa93b57db 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"):