diff options
author | hugovk <hugovk@users.noreply.github.com> | 2018-03-20 20:03:54 +0200 |
---|---|---|
committer | hugovk <hugovk@users.noreply.github.com> | 2018-03-20 20:03:54 +0200 |
commit | 117d3fe2d81f0df30cb49528809d650362ad7972 (patch) | |
tree | 37dab2d7e75141bb903ae97124cb0f7b06fb8821 | |
parent | 42aad6110a02a86a9a51a77c75c2d638a50656b7 (diff) | |
download | blinker-117d3fe2d81f0df30cb49528809d650362ad7972.tar.gz |
Drop support for EOL Python
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | README.md | 42 | ||||
-rw-r--r-- | blinker/_utilities.py | 10 | ||||
-rw-r--r-- | blinker/base.py | 2 | ||||
-rw-r--r-- | docs/source/index.rst | 2 | ||||
-rw-r--r-- | setup.py | 7 | ||||
-rw-r--r-- | tests/test_signals.py | 7 | ||||
-rw-r--r-- | tox.ini | 2 |
8 files changed, 25 insertions, 49 deletions
diff --git a/.travis.yml b/.travis.yml index 27f1391..b9d7c68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,6 @@ language: python python: - - "2.6" - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" @@ -9,31 +9,33 @@ interested parties to subscribe to events, or "signals". Signal receivers can subscribe to specific senders or receive signals sent by any sender. - >>> from blinker import signal - >>> started = signal('round-started') - >>> def each(round): - ... print "Round %s!" % round - ... - >>> started.connect(each) - - >>> def round_two(round): - ... print "This is round two." - ... - >>> started.connect(round_two, sender=2) - - >>> for round in range(1, 4): - ... started.send(round) - ... - Round 1! - Round 2! - This is round two. - Round 3! +```python +>>> from blinker import signal +>>> started = signal('round-started') +>>> def each(round): +... print "Round %s!" % round +... +>>> started.connect(each) + +>>> def round_two(round): +... print "This is round two." +... +>>> started.connect(round_two, sender=2) + +>>> for round in range(1, 4): +... started.send(round) +... +Round 1! +Round 2! +This is round two. +Round 3! +``` See the [Blinker documentation](https://pythonhosted.org/blinker/) for more information. ## Requirements -Blinker requires Python 2.4 or higher, Python 3.0 or higher, or Jython 2.5 or higher. +Blinker requires Python 2.7, Python 3.4 or higher, or Jython 2.5 or higher. ## Changelog Summary diff --git a/blinker/_utilities.py b/blinker/_utilities.py index 056270d..45e58ff 100644 --- a/blinker/_utilities.py +++ b/blinker/_utilities.py @@ -57,16 +57,6 @@ except: dict.__repr__(self)) -try: - from contextlib import contextmanager -except ImportError: - def contextmanager(fn): - def oops(*args, **kw): - raise RuntimeError("Python 2.5 or above is required to use " - "context managers.") - oops.__name__ = fn.__name__ - return oops - class _symbol(object): def __init__(self, name): diff --git a/blinker/base.py b/blinker/base.py index 3fd77d8..f16f22a 100644 --- a/blinker/base.py +++ b/blinker/base.py @@ -8,12 +8,12 @@ each manages its own receivers and message emission. The :func:`signal` function provides singleton behavior for named signals. """ +from contextlib import contextmanager from warnings import warn from weakref import WeakValueDictionary from blinker._utilities import ( WeakTypes, - contextmanager, defaultdict, hashable_identity, lazy_property, diff --git a/docs/source/index.rst b/docs/source/index.rst index 28976d8..a53cd81 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,7 +16,7 @@ The core of Blinker is quite small but provides powerful features: - thread safety Blinker was written by Jason Kirtand and is provided under the MIT -License. The library supports Python 2.4 or later; Python 3.0 or later; +License. The library supports Python 2.7 and Python 3.4 or later; or Jython 2.5 or later; or PyPy 1.6 or later. @@ -24,15 +24,8 @@ setup(name="blinker", 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.4', - 'Programming Language :: Python :: 2.5', - 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.0', - 'Programming Language :: Python :: 3.1', - 'Programming Language :: Python :: 3.2', - 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tests/test_signals.py b/tests/test_signals.py index a1172ed..2aa4b16 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -486,10 +486,3 @@ def test_named_blinker(): def values_are_empty_sets_(dictionary): for val in dictionary.values(): assert val == set() - -if sys.version_info < (2, 5): - def test_context_manager_warning(): - sig = blinker.Signal() - receiver = lambda sender: None - - assert_raises(RuntimeError, sig.connected_to, receiver) @@ -1,5 +1,5 @@ [tox] -envlist = py25,py26,py27,py30,py31,py32,py33,py34,py35,jython +envlist = py27,py34,py35,py36,jython [testenv] deps=nose |