diff --git a/mozdownload/scraper.py b/mozdownload/scraper.py index a9ae5d2f..788bf11a 100755 --- a/mozdownload/scraper.py +++ b/mozdownload/scraper.py @@ -709,20 +709,21 @@ def get_build_info(self): def query_versions(self, version=None): """Check specified version and resolve special values.""" - if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS: - return [version] - url = urljoin(self.base_url, 'releases/') parser = self._create_directory_parser(url) - if version: - versions = parser.filter(latest_version_filter(version, self.application)) - import mozilla_version - MozVersion = getattr(mozilla_version, APPLICATIONS_TO_VERSION_CLASS[self.application]) - versions.sort(key=MozVersion.parse) - return [versions[-1]] - else: + + if not version: return parser.entries + if version not in RELEASE_AND_CANDIDATE_LATEST_VERSIONS: + versions = parser.filter(version) + else: + versions = parser.filter(latest_version_filter(version, self.application)) + import mozilla_version + MozVersion = getattr(mozilla_version, APPLICATIONS_TO_VERSION_CLASS[self.application]) + versions.sort(key=MozVersion.parse) + return [versions[-1]] + class ReleaseCandidateScraper(ReleaseScraper): """Class to download a release candidate build of a Gecko based application."""