Author serhiy.storchaka
Recipients ezio.melotti, michael.foord, pitrou, serhiy.storchaka, terry.reedy, vajrasky
Date 2013-08-17.09:40:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I'm not sure I understand you Rietveld comment right Terry.

We can get rid of _have_ssl (this is implementation detail and shouldn't be required) and just try import ssl.

    import ssl
except ImportError:
    ssl = None

If ssl is not None but nntplib.NNTP_SSL doesn't exist the NetworkedNNTP_SSLTests tests will failed:

ERROR: setUpClass (test.test_nntplib.NetworkedNNTP_SSLTests)
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/test/", line 298, in setUpClass
    cls.server = cls.NNTP_CLASS(cls.NNTP_HOST, timeout=TIMEOUT, usenetrc=False)
TypeError: 'NoneType' object is not callable


This doesn't different from a case when some exception is raised in NNTP_SSL constructor.

We can add a separate test in MiscTests:

    @unittest.skipUnless(ssl, 'requires SSL support')
    def test_ssl_support(self):
        self.assertTrue(hasattr(nntplib, 'NNTP_SSL'))
Date User Action Args
2013-08-17 09:40:25serhiy.storchakasetrecipients: + serhiy.storchaka, terry.reedy, pitrou, ezio.melotti, michael.foord, vajrasky
2013-08-17 09:40:25serhiy.storchakasetmessageid: <>
2013-08-17 09:40:25serhiy.storchakalinkissue18702 messages
2013-08-17 09:40:25serhiy.storchakacreate