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