From cf1b025a53dc21e09327dfd28dcfb00befff30c1 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Mon, 16 Mar 2015 13:26:02 +0100 Subject: Initial travis support --- README.rst | 10 +++++----- documentation.py | 3 ++- documentation3.py | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/README.rst b/README.rst index 3a15f82..bd8fd44 100644 --- a/README.rst +++ b/README.rst @@ -5,7 +5,7 @@ Decorator module :E-mail: michele.simionato@gmail.com :Requires: Python 2.4+ :Download page: http://pypi.python.org/pypi/decorator -:Installation: ``easy_install decorator`` +:Installation: ``pip install decorator`` :License: BSD license Installation @@ -13,14 +13,14 @@ Installation If you are lazy, just perform -$ pip install decorator + `$ pip install decorator` which will install just the module on your system. If you prefer to install the full distribution from source, including the documentation, download the tarball_, unpack it and run -$ python setup.py install + `$ python setup.py install` in the main directory, possibly as superuser. @@ -32,11 +32,11 @@ Testing For Python 2.5, 2.6, 2.7 run -$ python documentation.py + `$ python documentation.py` for Python 3.X run -$ python3 documentation3.py + `$ python3 documentation3.py` You will see a few innocuous errors with Python 2.5, because some inner details such as the introduction of the ArgSpec namedtuple and diff --git a/documentation.py b/documentation.py index 86ba66f..1548b5c 100644 --- a/documentation.py +++ b/documentation.py @@ -1150,4 +1150,5 @@ def hello(user): if __name__ == '__main__': import doctest - doctest.testmod() + err = doctest.testmod()[0] + sys.exit(err) diff --git a/documentation3.py b/documentation3.py index c7be177..5be0cca 100644 --- a/documentation3.py +++ b/documentation3.py @@ -774,9 +774,8 @@ you will get a ``NameError``: def f(_func_): return _call_(_func_, _func_) -Finally, the implementation is such that the decorated function contains -a *copy* of the original function dictionary -(``vars(decorated_f) is not vars(f)``): +Finally, the implementation is such that the decorated function shares +the original function dictionary: .. code-block:: python @@ -789,8 +788,8 @@ a *copy* of the original function dictionary >>> traced_f.attr1 'something' >>> traced_f.attr2 = "something different" # setting attr - >>> f.attr2 # the original attribute did not change - 'something else' + >>> f.attr2 # the original attribute did change, works in Python 3.4 + 'something different' Compatibility notes --------------------------------------------------------------- @@ -1211,4 +1210,5 @@ def hello(user): if __name__ == '__main__': import doctest - doctest.testmod() + err = doctest.testmod()[0] + sys.exit(err) -- cgit v1.2.1