Merge lp:~jelmer/brz/ignorefilterwarning into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: 7212
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/ignorefilterwarning
Merge into: lp:brz
Diff against target: 13 lines (+4/-1)
1 file modified
breezy/symbol_versioning.py (+4/-1)
To merge this branch: bzr merge lp:~jelmer/brz/ignorefilterwarning
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+360969@code.launchpad.net

Commit message

Don't throw an incomprehensible traceback when a warning filter has already been removed.

Description of the change

Don't throw an incomprehensible traceback when a warning filter has already been removed.

I'm not entirely sure about this one; perhaps we should just not do any filtering of warnings in the code?

To post a comment you must log in.
Martin Packman (gz) wrote :

I think this is actually reasonable, cleanup() should try to not throw things, only edgy bit is depending on the exception type raised by the remove() but seems fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/symbol_versioning.py'
2--- breezy/symbol_versioning.py 2018-11-17 16:53:10 +0000
3+++ breezy/symbol_versioning.py 2018-12-15 17:02:59 +0000
4@@ -317,7 +317,10 @@
5 """
6 def cleanup():
7 if filter:
8- warnings.filters.remove(filter)
9+ try:
10+ warnings.filters.remove(filter)
11+ except IndexError:
12+ pass
13 return cleanup
14
15

Subscribers

People subscribed via source and target branches