diff --git a/automaton/machines.py b/automaton/machines.py index b69c72a..7f1891d 100644 --- a/automaton/machines.py +++ b/automaton/machines.py @@ -20,9 +20,9 @@ except ImportError: from ordereddict import OrderedDict # noqa import collections -import warnings import weakref +from debtcollector import removals import prettytable import six @@ -79,15 +79,15 @@ class FiniteMachine(object): return cls._Effect(new_state['reactions'].get(event), new_state["terminal"]) + @removals.removed_kwarg('default_start_state', + message="The usage of 'default_start_state' via" + " the machine constructor is deprecated and will" + " be removed in a future version; usage of" + " the 'default_start_state' property setter is" + " recommended.") def __init__(self, default_start_state=None): self._transitions = {} self._states = OrderedDict() - if default_start_state is not None: - warnings.warn("The usage of 'default_start_state' via the machine" - " constructor is deprecated and will be removed in a" - " future version; usage of the 'default_start_state'" - " property setter is recommended.", - DeprecationWarning, stacklevel=2) self._default_start_state = default_start_state self._current = None self._runner = _FiniteRunner(self) diff --git a/requirements.txt b/requirements.txt index 67d2b9f..87a6d7c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,6 +8,9 @@ pbr>=0.11,<2.0 # Python 2->3 compatibility library. six>=1.9.0 +# For deprecation of things +debtcollector>=0.3.0 # Apache-2.0 + # Only needed on python 2.6 ordereddict