Before this patch the code below produced a segfault: >>> reference.delete() >>> reference.name Now an exception is raised.