Merge pull request #957 from kuba/py2.6-3

Python 2.6 and 3.3+ support
This commit is contained in:
bmw
2015-10-22 13:33:09 -07:00
6 changed files with 20 additions and 10 deletions
+1
View File
@@ -17,6 +17,7 @@ env:
- GOPATH=/tmp/go
- PATH=$GOPATH/bin:$PATH
matrix:
- TOXENV=py26 BOULDER_INTEGRATION=1
- TOXENV=py27 BOULDER_INTEGRATION=1
- TOXENV=lint
- TOXENV=cover
+3
View File
@@ -59,6 +59,9 @@ setup(
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Security',
],
+11 -6
View File
@@ -17,7 +17,12 @@ class StreamHandler(logging.StreamHandler):
"""
def __init__(self, stream=None):
super(StreamHandler, self).__init__(stream)
if sys.version_info < (2, 7):
# pragma: no cover
# pylint: disable=non-parent-init-called
logging.StreamHandler.__init__(self, stream)
else:
super(StreamHandler, self).__init__(stream)
self.colored = (sys.stderr.isatty() if stream is None else
stream.isatty())
self.red_level = logging.WARNING
@@ -31,10 +36,10 @@ class StreamHandler(logging.StreamHandler):
:rtype: str
"""
output = super(StreamHandler, self).format(record)
out = (logging.StreamHandler.format(self, record)
if sys.version_info < (2, 7)
else super(StreamHandler, self).format(record))
if self.colored and record.levelno >= self.red_level:
return ''.join((le_util.ANSI_SGR_RED,
output,
le_util.ANSI_SGR_RESET))
return ''.join((le_util.ANSI_SGR_RED, out, le_util.ANSI_SGR_RESET))
else:
return output
return out
+2 -3
View File
@@ -228,9 +228,8 @@ class CertLoaderTest(unittest.TestCase):
def test_load_invalid_cert(self):
from letsencrypt.crypto_util import pyopenssl_load_certificate
bad_cert_data = CERT.replace("BEGIN CERTIFICATE", "ASDFASDFASDF!!!")
with self.assertRaises(errors.Error):
pyopenssl_load_certificate(bad_cert_data)
self.assertRaises(
errors.Error, pyopenssl_load_certificate, bad_cert_data)
class NotBeforeTest(unittest.TestCase):
+1
View File
@@ -99,6 +99,7 @@ setup(
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Security',
+2 -1
View File
@@ -6,7 +6,7 @@
# acme and letsencrypt are not yet on pypi, so when Tox invokes
# "install *.zip", it will not find deps
skipsdist = true
envlist = py27,cover,lint
envlist = py26,py27,py33,py34,cover,lint
# nosetest -v => more verbose output, allows to detect busy waiting
# loops, especially on Travis
@@ -48,6 +48,7 @@ commands =
./tox.cover.sh
[testenv:lint]
# recent versions of pylint do not support Python 2.6 (#97, #187)
basepython = python2.7
# separating into multiple invocations disables cross package
# duplicate code checking; if one of the commands fails, others will