scanpypi: rework download_package error handling
authorYegor Yefremov <yegorslists@googlemail.com>
Wed, 13 Jun 2018 07:37:10 +0000 (09:37 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 15 Jun 2018 12:06:43 +0000 (14:06 +0200)
commitfb775f4c87c627537efbb56f2663d6079489f018
tree088e9e5184394c4c9ebe3a9f497ee26a4e024320
parent3bf2745a0f310f2d0b173cc30645bb8ecadaa0a2
scanpypi: rework download_package error handling

Some packages don't provide source archive but only a wheel file. In
this case download variable is not defined. So define this variable at
the very beginning and check whether it is None after searching for
source archives in the metadata.

Bonus: fix PEP8 issue with wrong indentation.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
utils/scanpypi