Skip to content

Commit

Permalink
Fixes and non-critical testing for Python 3.10-dev (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
avylove authored Jul 28, 2020
2 parents 8f66e57 + 29eebce commit 657b7c9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ matrix:
env: TOXENV=py38,codecov COVERAGE_ID=travis-ci TEST_RAW=yes
- python: 3.9-dev
env: TOXENV=py39,codecov TEST_QUICK=1 COVERAGE_ID=travis-ci TOXPYTHON=3.9
- python: 3.10-dev
env: TOXENV=py310,codecov TEST_QUICK=1 COVERAGE_ID=travis-ci TOXPYTHON=3.10
- python: 2.7
os: windows
language: shell
Expand All @@ -41,6 +43,7 @@ matrix:
allow_failures:
- python: 2.6
- python: 3.9-dev
- python: 3.10-dev

install:
- pip install tox
Expand Down
5 changes: 3 additions & 2 deletions blessed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,19 @@
http://pypi.python.org/pypi/blessed
"""
# std imports
import sys as _sys
import platform as _platform

if _platform.system() == 'Windows':
from blessed.win_terminal import Terminal
else:
from blessed.terminal import Terminal

if ('3', '0', '0') <= _platform.python_version_tuple() < ('3', '2', '2+'):
if (3, 0, 0) <= _sys.version_info[:3] < (3, 2, 3):
# Good till 3.2.10
# Python 3.x < 3.2.3 has a bug in which tparm() erroneously takes a string.
raise ImportError('Blessed needs Python 3.2.3 or greater for Python 3 '
'support due to http://bugs.python.org/issue10570.')

__all__ = ('Terminal',)
__version__ = '1.17.8'
__version__ = '1.17.9'
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Version History
not attached. :ghissue:`69`.
* deprecated: using argument ``_intr_continue`` to method :meth:`~Terminal.kbhit`, behavior is as
though such value is always True since 1.9.
* bugfix: Now imports on 3.10+

1.16
* introduced: Windows support?! :ghpull:`110` by :ghuser:`avylove`.
Expand Down
3 changes: 1 addition & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ def test_python3_2_raises_exception(monkeypatch):
"""Test python version 3.0 through 3.2 raises an exception."""
import blessed

monkeypatch.setattr('platform.python_version_tuple',
lambda: ('3', '2', '2'))
monkeypatch.setattr('sys.version_info', (3, 2, 2, 'final', 0))

try:
reload_module(blessed)
Expand Down
4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ commands = {envbindir}/py.test --cov-config={toxinidir}/tox.ini \
setenv = TEST_QUICK=1
basepython = python3.9

[testenv:py310]
setenv = TEST_QUICK=1
basepython = python3.10

[testenv:develop]
commands = {posargs}

Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version": "1.17.8"}
{"version": "1.17.9"}

0 comments on commit 657b7c9

Please sign in to comment.