]> granicus.if.org Git - python/commit
Quality control, meet exceptions.c.
authorMichael W. Hudson <mwh@python.net>
Sun, 28 May 2006 15:51:40 +0000 (15:51 +0000)
committerMichael W. Hudson <mwh@python.net>
Sun, 28 May 2006 15:51:40 +0000 (15:51 +0000)
commit22a80e7cb0f96b803b22ab3e908bf83d21704e7c
treec475ae04326e20e1e09a0fba688243092f27d673
parent80f8e80c15a784a84f77f4895318d13b831b017e
Quality control, meet exceptions.c.

Fix a number of problems with the need for speed code:

One is doing this sort of thing:

    Py_DECREF(self->field);
    self->field = newval;
    Py_INCREF(self->field);

without being very sure that self->field doesn't start with a
value that has a __del__, because that almost certainly can lead
to segfaults.

As self->args is constrained to be an exact tuple we may as well
exploit this fact consistently.  This leads to quite a lot of
simplification (and, hey, probably better performance).

Add some error checking in places lacking it.

Fix some rather strange indentation in the Unicode code.

Delete some trailing whitespace.

More to come, I haven't fixed all the reference leaks yet...
Objects/exceptions.c