File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1509,15 +1509,16 @@ def handle_AUTHINFO(self, *args):
15091509 Handler , nntplib .NNTPPermanentError , authinfo_response ,
15101510 login , password )
15111511
1512- if ssl is not None :
1513- class MockSslTests (MockSocketTests ):
1514- class nntp_class (nntplib .NNTP_SSL ):
1515- def __init__ (self , * pos , ** kw ):
1516- class bypass_context :
1517- """Bypass encryption and actual SSL module"""
1518- def wrap_socket (sock , ** args ):
1519- return sock
1520- return super ().__init__ (* pos , ssl_context = bypass_context , ** kw )
1512+ class bypass_context :
1513+ """Bypass encryption and actual SSL module"""
1514+ def wrap_socket (sock , ** args ):
1515+ return sock
1516+
1517+ @unittest .skipUnless (ssl , 'requires SSL support' )
1518+ class MockSslTests (MockSocketTests ):
1519+ @staticmethod
1520+ def nntp_class (* pos , ** kw ):
1521+ return nntplib .NNTP_SSL (* pos , ssl_context = bypass_context , ** kw )
15211522
15221523
15231524if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments