We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 486bbb2 commit 42cc420Copy full SHA for 42cc420
1 file changed
dl/repo.py
@@ -23,6 +23,8 @@ async def repo_download(client: Client, message: Message):
23
24
await message.edit_text(f"<code>Fetching repository info for {repo}...</code>")
25
26
+ zip_filename = None
27
+
28
async with aiohttp.ClientSession() as session:
29
try:
30
async with session.get(f"https://api.github.com/repos/{repo}") as resp:
@@ -72,7 +74,7 @@ async def repo_download(client: Client, message: Message):
72
74
except Exception as e:
73
75
await message.edit_text(format_exc(e))
76
finally:
- if os.path.exists(zip_filename):
77
+ if zip_filename and os.path.exists(zip_filename):
78
os.remove(zip_filename)
79
80
0 commit comments