Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
exceptions in default arguments are handled correctly
- Loading branch information
Showing
with
2 additions
and
1 deletion.
-
+0
−1
tests/test_main.py
-
+2
−0
topaz/frame.py
|
@@ -257,7 +257,6 @@ class X |
|
|
"\tfrom {}:1:in `<main>'", |
|
|
]) |
|
|
|
|
|
@pytest.mark.xfail |
|
|
def test_traceback_default_arg(self, space, tmpdir, capfd): |
|
|
self.assert_traceback(space, tmpdir, capfd, """ |
|
|
def f(a=1 / 0) |
|
|
|
@@ -69,8 +69,10 @@ def handle_args(self, space, bytecode, args_w, block): |
|
|
defl_start = len(args_w) - (len(bytecode.arg_pos) - len(bytecode.defaults)) |
|
|
for i in xrange(len(bytecode.arg_pos) - len(args_w)): |
|
|
bc = bytecode.defaults[i + defl_start] |
|
|
self.bytecode = bc |
|
|
w_value = Interpreter().interpret(space, self, bc) |
|
|
self._set_arg(space, bytecode.arg_pos[i + len(args_w)], w_value) |
|
|
self.bytecode = bytecode |
|
|
|
|
|
if bytecode.splat_arg_pos != -1: |
|
|
if len(bytecode.arg_pos) > len(args_w): |
|
|