[MERGE][#303206] Call PyErr_NoMemory() before returning NULL in PatienceSequenceMatcher_new.

John Arbash Meinel john at arbash-meinel.com
Sat Nov 29 01:03:16 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Andrew Bennetts wrote:
> This one-liner hopefully fixes a SystemError in _patiencediff_c.  If a
> malloc call in PatienceSequenceMatcher_new returned NULL, we were returning
> NULL from PatienceSequenceMatcher_new without setting a Python exception,
> thus the SystemError.  This patch calls PyErr_NoMemory before the return, to
> cause a MemoryError instead.
> 
> This doesn't fix <https://bugs.launchpad.net/bzr/+bug/303206>, but hopefully
> it will at least make it fail with an appropriate exception (and make it
> possible to write code that catches the MemoryError and falls back to
> something less memory hungry, perhaps just dumping THIS/OTHER files to
> disk?)
> 
> -Andrew.
> 
> 

BB:approve

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkkwlNQACgkQJdeBCYSNAANe2QCgkBbqxvBdfy17pthwYfEOjqqE
oJYAniQwjWzl9kKzZNY8goB/WknU24aO
=J1K/
-----END PGP SIGNATURE-----



More information about the bazaar mailing list