summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2015-03-16 13:26:02 +0100
committerMichele Simionato <michele.simionato@gmail.com>2015-03-16 13:26:02 +0100
commitcf1b025a53dc21e09327dfd28dcfb00befff30c1 (patch)
tree1cf091454ba08cfe601848b9a8bab79d9a281082
parentb68244d7e84dbc9c4d805c79d9a644e3526146ce (diff)
downloadpython-decorator-git-cf1b025a53dc21e09327dfd28dcfb00befff30c1.tar.gz
Initial travis support
-rw-r--r--README.rst10
-rw-r--r--documentation.py3
-rw-r--r--documentation3.py12
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)