Skip to content

Commit be8aff8

Browse files
authored
Update packager.py (#599)
1 parent 71507de commit be8aff8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

async_packager/packager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
def handle_message(message):
3737
package_file = None
38+
dst = None
3839
try:
3940
logger.info("%(spacer)s new message %(spacer)s" % {"spacer": "*" * 20})
4041

@@ -135,9 +136,9 @@ def handle_message(message):
135136
handler.update_status(download_id, handler.PACKAGE_STATUS["FAILED"], 50)
136137
finally:
137138
package_file = None
138-
if os.path.exists(dst.name):
139+
if dst is not None and os.path.exists(dst.name):
139140
shutil.rmtree(dst.name, ignore_errors=True)
140-
dst = None
141+
dst = None
141142
message.delete()
142143

143144
return 0

0 commit comments

Comments
 (0)