summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-05-23 22:49:07 (GMT)
committerGuido van Rossum <guido@python.org>1996-05-23 22:49:07 (GMT)
commit795ba583f263f240ec30e2021f3f49622e8ff78f (patch)
treed81cfe37dd392bdbfc15f83c8251e60c7ed632d7
parent441e4ab802cadf2543d2c9af1e4070c59f03a08c (diff)
downloadcpython-795ba583f263f240ec30e2021f3f49622e8ff78f.zip
cpython-795ba583f263f240ec30e2021f3f49622e8ff78f.tar.gz
cpython-795ba583f263f240ec30e2021f3f49622e8ff78f.tar.bz2
Removed some redundant header includes.
dir(object) now returns object.__dict__.keys() even if __dict__ is not a dictionary.
-rw-r--r--Python/bltinmodule.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index a09cd6f..0eedb65 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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;