summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-01-02 19:07:15 (GMT)
committerGuido van Rossum <guido@python.org>1995-01-02 19:07:15 (GMT)
commitd7047b395e392ce9e46f9a83480ade8b37f6d5b0 (patch)
tree9dabdcc762d49aebc28d82372ca9d79bdbe23cf8 /Objects/classobject.c
parent1ae940a5870df2f706fa884afd533847f6b0b1a8 (diff)
downloadcpython-d7047b395e392ce9e46f9a83480ade8b37f6d5b0.zip
cpython-d7047b395e392ce9e46f9a83480ade8b37f6d5b0.tar.gz
cpython-d7047b395e392ce9e46f9a83480ade8b37f6d5b0.tar.bz2
Lots of minor changes. Note for mappingobject.c: the hash table pointer
can now be NULL.
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 7d8a8e9..376f031 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -247,7 +247,6 @@ addaccess(class, inst)
pos = 0;
while (mappinggetnext(class->cl_dict, &pos, &key, &value)) {
- object *v;
if (!is_accessobject(value))
continue;
if (hasaccessvalue(value))
@@ -274,7 +273,6 @@ newinstanceobject(class, arg)
object *arg;
{
register instanceobject *inst;
- object *v;
object *init;
if (!is_classobject(class)) {
err_badcall();
@@ -328,12 +326,12 @@ static void
instance_dealloc(inst)
register instanceobject *inst;
{
- object *error_type, *error_value;
+ object *error_type, *error_value, *error_traceback;
object *del;
/* Call the __del__ method if it exists. First temporarily
revive the object and save the current exception, if any. */
INCREF(inst);
- err_get(&error_type, &error_value);
+ err_fetch(&error_type, &error_value, &error_traceback);
if ((del = instance_getattr1(inst, "__del__")) != NULL) {
object *args = newtupleobject(0);
object *res = args;
@@ -345,7 +343,7 @@ instance_dealloc(inst)
/* XXX If __del__ raised an exception, it is ignored! */
}
/* Restore the saved exception and undo the temporary revival */
- err_setval(error_type, error_value);
+ err_restore(error_type, error_value, error_traceback);
/* Can't use DECREF here, it would cause a recursive call */
if (--inst->ob_refcnt > 0)
return; /* __del__ added a reference; don't delete now */
@@ -427,6 +425,7 @@ instance_getattr(inst, name)
}
}
#endif
+ err_clear();
args = mkvalue("(Os)", inst, name);
if (args == NULL)
return NULL;