[MERGE][#303206] Call PyErr_NoMemory() before returning NULL in PatienceSequenceMatcher_new.
Andrew Bennetts
andrew.bennetts at canonical.com
Sat Nov 29 00:36:50 GMT 2008
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patiencediff_c-fix-3873.patch
Type: text/x-diff
Size: 2565 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20081129/ed5e4b16/attachment-0001.bin
More information about the bazaar
mailing list