bpo-42427: Use the errno attribute of OSError instead of args[0] (GH-23449)

This commit is contained in:
Serhiy Storchaka 2020-11-22 10:28:34 +02:00 committed by GitHub
parent bd8c22e1fa
commit c4d45ee670
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 11 deletions

View file

@ -163,7 +163,7 @@ class SMTPChannel(asynchat.async_chat):
# a race condition may occur if the other end is closing
# before we can get the peername
self.close()
if err.args[0] != errno.ENOTCONN:
if err.errno != errno.ENOTCONN:
raise
return
print('Peer:', repr(self.peer), file=DEBUGSTREAM)