#include "fileobject.h"
#include "methodobject.h"
#include "objimpl.h"
+#include "errors.h"
typedef struct {
OB_HEAD
return newmethodobject(ml->ml_name, ml->ml_meth,
(object *)f);
}
- errno = ESRCH;
+ err_setstr(NameError, name);
return NULL;
}
#include "dictobject.h"
#include "moduleobject.h"
#include "objimpl.h"
+#include "errors.h"
typedef struct {
OB_HEAD
char *name;
{
object *res = dictlookup(m->md_dict, name);
- if (res == NULL) {
- if (errno == ENOENT)
- errno = ESRCH;
- }
+ if (res == NULL)
+ err_setstr(NameError, name);
else
INCREF(res);
return res;