Message195455
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.
try:
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/test_nntplib.py", 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:25 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, terry.reedy, pitrou, ezio.melotti, michael.foord, vajrasky |
2013-08-17 09:40:25 | serhiy.storchaka | set | messageid: <1376732425.55.0.119801155464.issue18702@psf.upfronthosting.co.za> |
2013-08-17 09:40:25 | serhiy.storchaka | link | issue18702 messages |
2013-08-17 09:40:25 | serhiy.storchaka | create | |
|