Use AttributeError.
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index d306587..3ebdb37 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -170,6 +170,6 @@
 		if (strcmp(name, ml->ml_name) == 0)
 			return newmethodobject(ml->ml_name, ml->ml_meth, op);
 	}
-	err_setstr(NameError, name);
+	err_setstr(AttributeError, name);
 	return NULL;
 }