Author: Armin Rigo <[email protected]>
Branch: py3k-kwonly-builtin
Changeset: r86354:85917066f6c4
Date: 2016-08-20 18:30 +0200
http://bitbucket.org/pypy/pypy/changeset/85917066f6c4/
Log: Test and fix
diff --git a/pypy/interpreter/gateway.py b/pypy/interpreter/gateway.py
--- a/pypy/interpreter/gateway.py
+++ b/pypy/interpreter/gateway.py
@@ -999,6 +999,7 @@
elif isinstance(spec, WrappedDefault):
assert name.startswith('w_')
defaultval = spec.default_value
+ w_def = Ellipsis
if defaultval is not NO_DEFAULT:
if name != '__args__' and name != 'args_w':
diff --git a/pypy/interpreter/test/test_gateway.py
b/pypy/interpreter/test/test_gateway.py
--- a/pypy/interpreter/test/test_gateway.py
+++ b/pypy/interpreter/test/test_gateway.py
@@ -874,6 +874,15 @@
check(x1=5, y1=1234, y2=343)
check(x1=5, x2=1, y1=1234, y2=343)
+ def test_unwrap_spec_kwonly_default_2(self):
+ space = self.space
+ @gateway.unwrap_spec(w_x2=WrappedDefault(50))
+ def g(space, w_x2=None):
+ return w_x2
+ w_g = space.wrap(gateway.interp2app_temp(g))
+ w_res = space.call_function(w_g)
+ assert space.eq_w(w_res, space.wrap(50))
+
class AppTestPyTestMark:
@py.test.mark.unlikely_to_exist
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit