[Downloader] Fix UnboundLocalError in cog update that happened when cogs were already up-to-date. (#3230)

* Update downloader.py

* Create 3229.misc.rst
This commit is contained in:
jack1142 2019-12-28 00:53:38 +01:00 committed by Michael H
parent aabdabf3bc
commit f9211ff50f
2 changed files with 2 additions and 0 deletions

View File

@ -0,0 +1 @@
Fix `UnboundLocalError` in cog update that happened when cogs were already up-to-date.

View File

@ -859,6 +859,7 @@ class Downloader(commands.Cog):
pinned_cogs = {cog for cog in cogs_to_check if cog.pinned}
cogs_to_check -= pinned_cogs
if not cogs_to_check:
cogs_to_update = libs_to_update = ()
message += _("There were no cogs to check.")
if pinned_cogs:
cognames = [cog.name for cog in pinned_cogs]