Skip to content

Commit

Permalink
Convert SSL.SSLError to ssl.SSLError
Browse files Browse the repository at this point in the history
  • Loading branch information
chaen committed Apr 11, 2022
1 parent 4cfd4c0 commit 1a0c70f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tornado_m2crypto/m2iostream.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def get(self):
import errno
import os
import socket
import ssl

from tornado_m2crypto.m2netutil import m2_wrap_socket

Expand Down Expand Up @@ -188,7 +189,7 @@ def _do_ssl_handshake(self):
gen_log.error("Err Str: %s" % Err.get_error_reason(err_num))
return self.close()
except SSL.SSLError as e:
raise
raise ssl.SSLError(*e.args)
except socket.error as err:
gen_log.error("Socket error!")
# Some port scans (e.g. nmap in -sT mode) have been known
Expand Down Expand Up @@ -302,8 +303,7 @@ def read_from_fd(self, buf):
if e.args[0] == m2.ssl_error_want_read:
return None
else:

raise
raise ssl.SSLError(*e.args)
except socket.error as e:
if e.args[0] in _ERRNO_WOULDBLOCK:
return None
Expand Down

0 comments on commit 1a0c70f

Please sign in to comment.