Commit 795ba583 authored by Guido van Rossum's avatar Guido van Rossum

Removed some redundant header includes.

dir(object) now returns object.__dict__.keys() even if __dict__ is not
a dictionary.
parent 441e4ab8
......@@ -28,12 +28,8 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include "node.h"
#include "graminit.h"
#include "sysmodule.h"
#include "bltinmodule.h"
#include "import.h"
#include "pythonrun.h"
#include "ceval.h"
#include "modsupport.h"
#include "compile.h"
#include "eval.h"
......@@ -356,7 +352,11 @@ builtin_dir(self, args)
}
}
else {
v = newlistobject(0);
v = PyObject_CallMethod(d, "keys", NULL);
if (v == NULL) {
PyErr_Clear();
v = newlistobject(0);
}
}
DECREF(d);
return 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