Merge lp:~jameinel/bzr/pyrex_099_bug_582656 into lp:bzr/2.0
Status: | Merged |
---|---|
Approved by: | Robert Collins |
Approved revision: | no longer in the source branch. |
Merged at revision: | 4749 |
Proposed branch: | lp:~jameinel/bzr/pyrex_099_bug_582656 |
Merge into: | lp:bzr/2.0 |
Diff against target: |
72 lines (+8/-8) 1 file modified
bzrlib/_dirstate_helpers_pyx.pyx (+8/-8) |
To merge this branch: | bzr merge lp:~jameinel/bzr/pyrex_099_bug_582656 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins (community) | Approve | ||
Review via email: mp+25625@code.launchpad.net |
Commit message
Work around a bug (#582656) in how Pyrex handles catching exceptions.
Description of the change
This is a workaround for pyrex bug #582656. Basically, new versions of pyrex broke code that catches an exception but doesn't assign it to an object. Stuff like:
...
except Exception:
do_stuff
It seems to be leaving the trapped exception on the stack (PyErr_Occurred() == True). Which means that if 'do_stuff()' calls a function with indeterminate exception state, it can cause the exception to get raised.
In the bug, we were doing:
except KeyError:
...
if x == y:
...
And PyObject_Cmp() seems to have a side-effect exception check.
Anyway, the workaround is to just change all of those exception catches to assigning it to a variable, such as:
except Exception, _:
_dirstate_
grep -rnI "^\s.*except[
I've also sent a bug report to the pyrex mailing list (since I don't think they have a real bug tracker.)
I'm proposing this for 2.0 and expecting it to propagate up.
Doit.