Close buffered_file only if it exists
This commit is contained in:
@@ -1310,6 +1310,7 @@ class Bot(TelegramBot, ObjectWithDatabase, MultiLanguageObject):
|
|||||||
['path']
|
['path']
|
||||||
)
|
)
|
||||||
finally:
|
finally:
|
||||||
|
if buffered_file:
|
||||||
buffered_file.close()
|
buffered_file.close()
|
||||||
if (
|
if (
|
||||||
type(sent_update) is dict
|
type(sent_update) is dict
|
||||||
|
Reference in New Issue
Block a user