summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Simionato <michele.simionato@gmail.com>2011-09-01 12:01:08 +0200
committerMichele Simionato <michele.simionato@gmail.com>2011-09-01 12:01:08 +0200
commit351fc5dec22db3dec9a71a7616c3680b8f2bc9a7 (patch)
tree6eb8f15050792dcecade2e011b8a6245a9b6f8e2
parent61bddea8bc0576237fc91c90b52bbb5dca60cae1 (diff)
parentca5a74f25f4443e55c1ba0af08131d1d9a400528 (diff)
downloadmicheles-351fc5dec22db3dec9a71a7616c3680b8f2bc9a7.tar.gz
Merged back the changes for decorator 3.3.2
-rw-r--r--decorator/CHANGES.txt2
-rw-r--r--decorator/documentation.html4
-rw-r--r--decorator/documentation.pdf10
-rw-r--r--decorator/documentation3.html4
-rw-r--r--decorator/documentation3.pdf10
-rw-r--r--decorator/documentation3.py9
-rw-r--r--decorator/src/decorator.py3
-rw-r--r--decorator/test.py11
8 files changed, 35 insertions, 18 deletions
diff --git a/decorator/CHANGES.txt b/decorator/CHANGES.txt
index ea4fd30..cbc1913 100644
--- a/decorator/CHANGES.txt
+++ b/decorator/CHANGES.txt
@@ -1,6 +1,8 @@
HISTORY
----------
+3.3.2 Fixed a bug with __kwdefaults__ for Python 3, submitted by Chris
+ Ellison (01/09/2011)
3.3.1 Fixed a doctest broken for Python 3.2, as noted by
Arfrever Frehtes Taifersar Arahesis; changed the name of
the attribute ``undecorated`` to ``__wrapped__`` following the
diff --git a/decorator/documentation.html b/decorator/documentation.html
index 5eac475..9239568 100644
--- a/decorator/documentation.html
+++ b/decorator/documentation.html
@@ -83,10 +83,10 @@
<tr class="field"><th class="docinfo-name">E-mail:</th><td class="field-body"><a class="reference external" href="mailto:michele.simionato&#64;gmail.com">michele.simionato&#64;gmail.com</a></td>
</tr>
<tr><th class="docinfo-name">Version:</th>
-<td>3.3.1 (2011-04-22)</td></tr>
+<td>3.3.2 (2011-09-01)</td></tr>
<tr class="field"><th class="docinfo-name">Requires:</th><td class="field-body">Python 2.4+</td>
</tr>
-<tr class="field"><th class="docinfo-name">Download page:</th><td class="field-body"><a class="reference external" href="http://pypi.python.org/pypi/decorator/3.3.1">http://pypi.python.org/pypi/decorator/3.3.1</a></td>
+<tr class="field"><th class="docinfo-name">Download page:</th><td class="field-body"><a class="reference external" href="http://pypi.python.org/pypi/decorator/3.3.2">http://pypi.python.org/pypi/decorator/3.3.2</a></td>
</tr>
<tr class="field"><th class="docinfo-name">Installation:</th><td class="field-body"><tt class="docutils literal">easy_install decorator</tt></td>
</tr>
diff --git a/decorator/documentation.pdf b/decorator/documentation.pdf
index 8d157c0..316d24f 100644
--- a/decorator/documentation.pdf
+++ b/decorator/documentation.pdf
@@ -56,7 +56,7 @@ endobj
6 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://pypi.python.org/pypi/decorator/3.3.1) >>
+ /URI (http://pypi.python.org/pypi/decorator/3.3.2) >>
/Border [ 0
0
0 ]
@@ -1101,7 +1101,7 @@ endobj
% 'R65': class PDFInfo
65 0 obj
<< /Author (Michele Simionato)
- /CreationDate (D:20110422140532-01'00')
+ /CreationDate (D:20110901114326-01'00')
/Creator (\(unspecified\))
/Keywords ()
/Producer (ReportLab PDF Library - www.reportlab.com)
@@ -1370,7 +1370,7 @@ q
1 0 0 1 91.03937 3 cm
q
0 0 0 rg
-BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (3.3.1 \(2011-04-22\)) Tj T* ET
+BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (3.3.2 \(2011-09-01\)) Tj T* ET
Q
Q
q
@@ -1413,7 +1413,7 @@ q
q
0 0 .501961 rg
0 0 .501961 RG
-BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (http://pypi.python.org/pypi/decorator/3.3.1) Tj T* ET
+BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (http://pypi.python.org/pypi/decorator/3.3.2) Tj T* ET
Q
Q
q
@@ -3819,7 +3819,7 @@ xref
trailer
<< /ID
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
- [(j\0040\345r\246\304\317^\320\374\244;\233v\\) (j\0040\345r\246\304\317^\320\374\244;\233v\\)]
+ [(z\354v,\321\373&\377\031\261\360~3\304]u) (z\354v,\321\373&\377\031\261\360~3\304]u)]
/Info 65 0 R
/Root 64 0 R
diff --git a/decorator/documentation3.html b/decorator/documentation3.html
index 3bd8448..2f87820 100644
--- a/decorator/documentation3.html
+++ b/decorator/documentation3.html
@@ -83,10 +83,10 @@
<tr class="field"><th class="docinfo-name">E-mail:</th><td class="field-body"><a class="reference external" href="mailto:michele.simionato&#64;gmail.com">michele.simionato&#64;gmail.com</a></td>
</tr>
<tr><th class="docinfo-name">Version:</th>
-<td>3.3.1 (2011-04-22)</td></tr>
+<td>3.3.2 (2011-09-01)</td></tr>
<tr class="field"><th class="docinfo-name">Requires:</th><td class="field-body">Python 2.4+</td>
</tr>
-<tr class="field"><th class="docinfo-name">Download page:</th><td class="field-body"><a class="reference external" href="http://pypi.python.org/pypi/decorator/3.3.1">http://pypi.python.org/pypi/decorator/3.3.1</a></td>
+<tr class="field"><th class="docinfo-name">Download page:</th><td class="field-body"><a class="reference external" href="http://pypi.python.org/pypi/decorator/3.3.2">http://pypi.python.org/pypi/decorator/3.3.2</a></td>
</tr>
<tr class="field"><th class="docinfo-name">Installation:</th><td class="field-body"><tt class="docutils literal">easy_install decorator</tt></td>
</tr>
diff --git a/decorator/documentation3.pdf b/decorator/documentation3.pdf
index dfe5550..2704270 100644
--- a/decorator/documentation3.pdf
+++ b/decorator/documentation3.pdf
@@ -56,7 +56,7 @@ endobj
6 0 obj
<< /A << /S /URI
/Type /Action
- /URI (http://pypi.python.org/pypi/decorator/3.3.1) >>
+ /URI (http://pypi.python.org/pypi/decorator/3.3.2) >>
/Border [ 0
0
0 ]
@@ -1155,7 +1155,7 @@ endobj
% 'R68': class PDFInfo
68 0 obj
<< /Author (Michele Simionato)
- /CreationDate (D:20110422140535-01'00')
+ /CreationDate (D:20110901114329-01'00')
/Creator (\(unspecified\))
/Keywords ()
/Producer (ReportLab PDF Library - www.reportlab.com)
@@ -1436,7 +1436,7 @@ q
1 0 0 1 91.03937 3 cm
q
0 0 0 rg
-BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (3.3.1 \(2011-04-22\)) Tj T* ET
+BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (3.3.2 \(2011-09-01\)) Tj T* ET
Q
Q
q
@@ -1479,7 +1479,7 @@ q
q
0 0 .501961 rg
0 0 .501961 RG
-BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (http://pypi.python.org/pypi/decorator/3.3.1) Tj T* ET
+BT 1 0 0 1 0 2 Tm /F1 10 Tf 12 TL (http://pypi.python.org/pypi/decorator/3.3.2) Tj T* ET
Q
Q
q
@@ -3890,7 +3890,7 @@ xref
trailer
<< /ID
% ReportLab generated PDF document -- digest (http://www.reportlab.com)
- [(\273't\320\022\223\213\331\357\277\357C\013\211\225\241) (\273't\320\022\223\213\331\357\277\357C\013\211\225\241)]
+ [(\007\240_\322R\251\2442\031\355\327P\333X\033s) (\007\240_\322R\251\2442\031\355\327P\333X\033s)]
/Info 68 0 R
/Root 67 0 R
diff --git a/decorator/documentation3.py b/decorator/documentation3.py
index a154f30..47d9c80 100644
--- a/decorator/documentation3.py
+++ b/decorator/documentation3.py
@@ -1054,5 +1054,14 @@ def a_test_for_pylons():
'The good old factorial'
"""
+def test_kwonlydefaults():
+ """
+ >>> @trace
+ ... def f(arg, defarg=1, *args, kwonly=2): pass
+ ...
+ >>> f.__kwdefaults__
+ {'kwonly': 2}
+ """
+
if __name__ == '__main__':
import doctest; doctest.testmod()
diff --git a/decorator/src/decorator.py b/decorator/src/decorator.py
index 67e2221..5daf10b 100644
--- a/decorator/src/decorator.py
+++ b/decorator/src/decorator.py
@@ -28,7 +28,7 @@ Decorator module, see http://pypi.python.org/pypi/decorator
for the documentation.
"""
-__version__ = '3.3.1'
+__version__ = '3.3.2'
__all__ = ["decorator", "FunctionMaker", "partial"]
@@ -127,6 +127,7 @@ class FunctionMaker(object):
func.__doc__ = getattr(self, 'doc', None)
func.__dict__ = getattr(self, 'dict', {})
func.func_defaults = getattr(self, 'defaults', ())
+ func.__kwdefaults__ = getattr(self, 'kwonlydefaults', None)
callermodule = sys._getframe(3).f_globals.get('__name__', '?')
func.__module__ = getattr(self, 'module', callermodule)
func.__dict__.update(kw)
diff --git a/decorator/test.py b/decorator/test.py
index 6c24b15..455fa1c 100644
--- a/decorator/test.py
+++ b/decorator/test.py
@@ -14,11 +14,16 @@ def identity(f, *a, **k):
def f1():
"f1"
+def getfname(func):
+ fname = os.path.basename(func.func_globals['__file__'])
+ return os.path.splitext(fname)[0] + '.py'
+
def test0():
- assert os.path.basename(identity.func_globals['__file__']) == 'test.py'
+ this = getfname(identity)
+ assert this == 'test.py', this
print(identity.__doc__)
def test1():
- assert os.path.basename(f1.func_globals['__file__']) == 'test.py'
+ this = getfname(f1)
+ assert this == 'test.py', this
print(f1.__doc__)
-