Skip to content
Permalink
Browse files

exceptions in default arguments are handled correctly

  • Loading branch information
alex committed Jun 22, 2013
1 parent 4fda4df commit b784ca2385bb3e2af60e9a48483f63b22cacd584
Showing with 2 additions and 1 deletion.
  1. +0 −1 tests/test_main.py
  2. +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):

0 comments on commit b784ca2

Please sign in to comment.