Merge lp:~brian-murray/aptdaemon/bug-875879 into lp:aptdaemon

Proposed by Brian Murray
Status: Merged
Merged at revision: 855
Proposed branch: lp:~brian-murray/aptdaemon/bug-875879
Merge into: lp:aptdaemon
Diff against target: 25 lines (+4/-0)
2 files modified
aptdaemon/gtk3widgets.py (+2/-0)
aptdaemon/gtkwidgets.py (+2/-0)
To merge this branch: bzr merge lp:~brian-murray/aptdaemon/bug-875879
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+122979@code.launchpad.net

Description of the change

In bug 875879 and on errors.ubuntu.com we can see that show_diff in gtk3widgets.py is crashing if there is no match. Its not clear to me why this might happen and we don't know which package is causing this issue but this should avoid the crash.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Seems fine to me, thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aptdaemon/gtk3widgets.py'
2--- aptdaemon/gtk3widgets.py 2012-05-12 02:09:10 +0000
3+++ aptdaemon/gtk3widgets.py 2012-09-05 23:42:19 +0000
4@@ -1094,6 +1094,8 @@
5 for line in difflib.unified_diff(from_lines, to_lines, lineterm=""):
6 if line.startswith("@@"):
7 match = re.match(self.REGEX_RANGE, line)
8+ if not match:
9+ continue
10 line_number = int(match.group("from_start"))
11 if line_number > 1:
12 insert_tagged_text(iter, self.ELLIPSIS, "default")
13
14=== modified file 'aptdaemon/gtkwidgets.py'
15--- aptdaemon/gtkwidgets.py 2012-05-08 18:50:57 +0000
16+++ aptdaemon/gtkwidgets.py 2012-09-05 23:42:19 +0000
17@@ -1036,6 +1036,8 @@
18 for line in difflib.unified_diff(from_lines, to_lines, lineterm=""):
19 if line.startswith("@@"):
20 match = re.match(self.REGEX_RANGE, line)
21+ if not match:
22+ continue
23 line_number = int(match.group("from_start"))
24 if line_number > 1:
25 self.buffer.insert_with_tags_by_name(iter, self.ELLIPSIS,

Subscribers

People subscribed via source and target branches

to status/vote changes: