diff options
author | Michael Howitz <mh@gocept.com> | 2020-07-16 08:40:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-16 08:40:37 +0200 |
commit | 25b69efd807cd3d9f7355ddd1fdc16bab933b63a (patch) | |
tree | 1afdfc743bbade876000dcda7195207d80e75396 | |
parent | 875be83c3f932a9d5bebdced76671dcbfedb3d55 (diff) | |
download | zope-exceptions-25b69efd807cd3d9f7355ddd1fdc16bab933b63a.tar.gz |
Add preliminary support for Python 3.9 (#16)
* Adapt tests to Python 3.9.
* Drop support for Python 3.5 as its sunset is in some months.
-rw-r--r-- | .travis.yml | 3 | ||||
-rw-r--r-- | CHANGES.rst | 4 | ||||
-rw-r--r-- | setup.cfg | 11 | ||||
-rw-r--r-- | setup.py | 1 | ||||
-rw-r--r-- | src/zope/exceptions/log.py | 2 | ||||
-rw-r--r-- | src/zope/exceptions/tests/test_exceptionformatter.py | 9 | ||||
-rw-r--r-- | tox.ini | 2 |
7 files changed, 14 insertions, 18 deletions
diff --git a/.travis.yml b/.travis.yml index bfeef7d..73fd48b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,12 @@ language: python python: - 2.7 - - 3.5 - 3.6 - 3.7 - 3.8 + - 3.9-dev - pypy + - pypy3 jobs: include: - name: flake8 diff --git a/CHANGES.rst b/CHANGES.rst index 9246e3d..f61c05b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,9 +5,9 @@ 4.4 (unreleased) ================ -- Add support for Python 3.8. +- Add support for Python 3.8 and preliminary support for 3.9b4. -- Drop support for Python 3.4. +- Drop support for Python 3.4 and 3.5. 4.3 (2018-10-04) @@ -1,13 +1,2 @@ -[nosetests] -nocapture=1 -cover-package=zope.exceptions -cover-erase=1 -with-doctest=0 -where=src - -[aliases] -dev = develop easy_install zope.exceptions[testing] -docs = easy_install zope.exceptions[docs] - [bdist_wheel] universal = 1 @@ -64,7 +64,6 @@ setup( 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', diff --git a/src/zope/exceptions/log.py b/src/zope/exceptions/log.py index 657ea7b..d5a6c30 100644 --- a/src/zope/exceptions/log.py +++ b/src/zope/exceptions/log.py @@ -19,7 +19,7 @@ import io from zope.exceptions.exceptionformatter import print_exception -Buffer = io.StringIO if bytes is not str else io.BytesIO +Buffer = io.StringIO if bytes is not str else io.BytesIO # PY2 class Formatter(logging.Formatter): diff --git a/src/zope/exceptions/tests/test_exceptionformatter.py b/src/zope/exceptions/tests/test_exceptionformatter.py index 23afe12..64729b1 100644 --- a/src/zope/exceptions/tests/test_exceptionformatter.py +++ b/src/zope/exceptions/tests/test_exceptionformatter.py @@ -17,6 +17,9 @@ import unittest import sys +IS_PY39_OR_GREATER = sys.version_info >= (3, 9) + + class TextExceptionFormatterTests(unittest.TestCase): def _getTargetClass(self): @@ -725,7 +728,11 @@ class Test_format_exception(unittest.TestCase): </p>""").format( module='zope.exceptions.tests.test_exceptionformatter', fn='test_format_exception_as_html', - ) + ) + if IS_PY39_OR_GREATER: # pragma: no cover + # Python 3.9 moves the pointer after the statement instead to the + # last character of it: + expected = expected.replace('^<br />', ' ^<br />') # HTML formatter uses Windows line endings for some reason. result = result.replace('\r\n', '\n') result = re.sub(r'line \d\d\d,', 'line ABC,', result) @@ -1,6 +1,6 @@ [tox] envlist = - py27,py35,py36,py37,py38,pypy,pypy3,coverage,docs + flake8,py27,py36,py37,py38,py39,pypy,pypy3,coverage,docs [testenv] commands = |