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- @unittest .skipUnless (ssl , 'requires SSL support' )
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+ 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 )
1521+
15211522
15221523if __name__ == "__main__" :
15231524 unittest .main ()
You can’t perform that action at this time.
0 commit comments