Commit Graph

17 Commits

Author SHA1 Message Date
Neal Norwitz 7a071939d9 SF #1499797, Fix for memory leak in WindowsError_str 2006-06-04 06:19:31 +00:00
Neal Norwitz 38d4d4a35b Fix memory leak found by valgrind. 2006-06-02 04:50:49 +00:00
Georg Brandl 85ac850834 Correctly unpickle 2.4 exceptions via __setstate__ (patch #1498571) 2006-06-01 06:39:19 +00:00
Georg Brandl b0432bc032 Do the check for no keyword arguments in __init__ so that
subclasses of Exception can be supplied keyword args
2006-05-30 08:17:00 +00:00
Georg Brandl 861089fc49 Disallow keyword args for exceptions. 2006-05-30 07:34:45 +00:00
Georg Brandl 05f97bffac Add a test case for exception pickling. args is never NULL. 2006-05-30 07:13:29 +00:00
Georg Brandl ddba473e26 Restore exception pickle support. #1497319. 2006-05-30 07:04:55 +00:00
Georg Brandl c7c51147c7 Fix refleak in socketmodule. Replace bogus Py_BuildValue calls.
Fix refleak in exceptions.
2006-05-29 09:46:51 +00:00
Thomas Wouters c1282eef0c Make last patch valid C89 so Windows compilers can deal with it. 2006-05-28 21:32:12 +00:00
Michael W. Hudson 27596279a2 use the UnicodeError traversal and clearing functions in UnicodeError
subclasses.
2006-05-28 21:19:03 +00:00
Georg Brandl 43ab100cdc Fix refleaks in UnicodeError get and set methods. 2006-05-28 20:57:09 +00:00
Michael W. Hudson 96495ee6dd Quality control, meet exceptions.c, round two.
Make some functions that should have been static static.

Fix a bunch of refleaks by fixing the definition of
MiddlingExtendsException.

Remove all the __new__ implementations apart from
BaseException_new.  Rewrite most code that needs it to cope with
NULL fields (such code could get excercised anyway, the
__new__-removal just makes it more likely).  This involved
editing the code for WindowsError, which I can't test.

This fixes all the refleaks in at least the start of a regrtest
-R :: run.
2006-05-28 17:40:29 +00:00
Michael W. Hudson 22a80e7cb0 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...
2006-05-28 15:51:40 +00:00
Richard Jones 2d555b356a move semicolons 2006-05-27 16:15:11 +00:00
Richard Jones c5b2a2e7b9 doc string additions and tweaks 2006-05-27 16:07:28 +00:00
Georg Brandl 94b8c122fd Remove spurious semicolons after macro invocations. 2006-05-27 14:41:55 +00:00
Richard Jones 7b9558d37d Conversion of exceptions over from faked-up classes to new-style C types. 2006-05-27 12:29:24 +00:00