Commit 46c214d8 authored by Benjamin Peterson's avatar Benjamin Peterson

capitialize enum members

parent b47b5394
...@@ -320,10 +320,10 @@ get_module_info(ZipImporter *self, PyObject *fullname) ...@@ -320,10 +320,10 @@ get_module_info(ZipImporter *self, PyObject *fullname)
} }
typedef enum { typedef enum {
fl_error, FL_ERROR,
fl_not_found, FL_NOT_FOUND,
fl_module_found, FL_MODULE_FOUND,
fl_ns_found FL_NS_FOUND
} find_loader_result; } find_loader_result;
/* The guts of "find_loader" and "find_module". Return values: /* The guts of "find_loader" and "find_module". Return values:
...@@ -341,7 +341,7 @@ find_loader(ZipImporter *self, PyObject *fullname, PyObject **namespace_portion) ...@@ -341,7 +341,7 @@ find_loader(ZipImporter *self, PyObject *fullname, PyObject **namespace_portion)
mi = get_module_info(self, fullname); mi = get_module_info(self, fullname);
if (mi == MI_ERROR) if (mi == MI_ERROR)
return fl_error; return FL_ERROR;
if (mi == MI_NOT_FOUND) { if (mi == MI_NOT_FOUND) {
/* Not a module or regular package. See if this is a directory, and /* Not a module or regular package. See if this is a directory, and
therefore possibly a portion of a namespace package. */ therefore possibly a portion of a namespace package. */
...@@ -356,13 +356,13 @@ find_loader(ZipImporter *self, PyObject *fullname, PyObject **namespace_portion) ...@@ -356,13 +356,13 @@ find_loader(ZipImporter *self, PyObject *fullname, PyObject **namespace_portion)
self->archive, SEP, self->archive, SEP,
self->prefix, fullname); self->prefix, fullname);
if (*namespace_portion == NULL) if (*namespace_portion == NULL)
return fl_error; return FL_ERROR;
return fl_ns_found; return FL_NS_FOUND;
} }
return fl_not_found; return FL_NOT_FOUND;
} }
/* This is a module or package. */ /* This is a module or package. */
return fl_module_found; return FL_MODULE_FOUND;
} }
...@@ -381,16 +381,16 @@ zipimporter_find_module(PyObject *obj, PyObject *args) ...@@ -381,16 +381,16 @@ zipimporter_find_module(PyObject *obj, PyObject *args)
return NULL; return NULL;
switch (find_loader(self, fullname, &namespace_portion)) { switch (find_loader(self, fullname, &namespace_portion)) {
case fl_error: case FL_ERROR:
return NULL; return NULL;
case fl_ns_found: case FL_NS_FOUND:
/* A namespace portion is not allowed via find_module, so return None. */ /* A namespace portion is not allowed via find_module, so return None. */
Py_DECREF(namespace_portion); Py_DECREF(namespace_portion);
/* FALL THROUGH */ /* FALL THROUGH */
case fl_not_found: case FL_NOT_FOUND:
result = Py_None; result = Py_None;
break; break;
case fl_module_found: case FL_MODULE_FOUND:
result = (PyObject *)self; result = (PyObject *)self;
break; break;
} }
...@@ -417,15 +417,15 @@ zipimporter_find_loader(PyObject *obj, PyObject *args) ...@@ -417,15 +417,15 @@ zipimporter_find_loader(PyObject *obj, PyObject *args)
return NULL; return NULL;
switch (find_loader(self, fullname, &namespace_portion)) { switch (find_loader(self, fullname, &namespace_portion)) {
case fl_error: case FL_ERROR:
return NULL; return NULL;
case fl_not_found: /* Not found, return (None, []) */ case FL_NOT_FOUND: /* Not found, return (None, []) */
result = Py_BuildValue("O[]", Py_None); result = Py_BuildValue("O[]", Py_None);
break; break;
case fl_module_found: /* Return (self, []) */ case FL_MODULE_FOUND: /* Return (self, []) */
result = Py_BuildValue("O[]", self); result = Py_BuildValue("O[]", self);
break; break;
case fl_ns_found: /* Return (None, [namespace_portion]) */ case FL_NS_FOUND: /* Return (None, [namespace_portion]) */
result = Py_BuildValue("O[O]", Py_None, namespace_portion); result = Py_BuildValue("O[O]", Py_None, namespace_portion);
Py_DECREF(namespace_portion); Py_DECREF(namespace_portion);
return result; return result;
......
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