Commit 0d83793a authored by Dylan Trotter's avatar Dylan Trotter Committed by GitHub

Fix panic in len() when grumpy.Len() raises. (#161)

parent d8ef329c
...@@ -448,7 +448,10 @@ func builtinLen(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) { ...@@ -448,7 +448,10 @@ func builtinLen(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) {
return nil, raised return nil, raised
} }
ret, raised := Len(f, args[0]) ret, raised := Len(f, args[0])
return ret.ToObject(), raised if raised != nil {
return nil, raised
}
return ret.ToObject(), nil
} }
func builtinMax(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) { func builtinMax(f *Frame, args Args, kwargs KWArgs) (*Object, *BaseException) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment