Commit 6131d3c2 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Don't segfault on repr() of functions without names

parent 35c8b3f9
......@@ -1602,6 +1602,8 @@ extern "C" BoxedString* builtinFunctionOrMethodRepr(BoxedBuiltinFunctionOrMethod
}
extern "C" BoxedString* functionRepr(BoxedFunction* v) {
if (!v->name)
return (BoxedString*)PyString_FromFormat("<function <name_missing?> at %p>", v);
return (BoxedString*)PyString_FromFormat("<function %s at %p>", PyString_AsString(v->name), v);
}
......
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