Message310774
You are right, but...
if there is an exception in the connect method before the init of
self.sock, the sock attribute will not exist and in this case, and only
in this case, there will be an exception in the close method.
your code will work fine if you use a try/finally but not in the case
where we use the with statement, for example.
with SMTP('myhost') as smtp:
smtp.do_something()
If there is an exception in the __init__ of SMTP and self.sock is not
initialized -> traceback. |
|
Date |
User |
Action |
Args |
2018-01-26 16:10:58 | matrixise | set | recipients:
+ matrixise, Romuald |
2018-01-26 16:10:58 | matrixise | link | issue32680 messages |
2018-01-26 16:10:58 | matrixise | create | |
|