diff options
Diffstat (limited to 'net/py-rt/patches/patch-rt.py')
-rw-r--r-- | net/py-rt/patches/patch-rt.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/net/py-rt/patches/patch-rt.py b/net/py-rt/patches/patch-rt.py new file mode 100644 index 00000000000..1b51bbcfe1e --- /dev/null +++ b/net/py-rt/patches/patch-rt.py @@ -0,0 +1,29 @@ +$NetBSD: patch-rt.py,v 1.1.2.2 2019/06/16 18:10:29 spz Exp $ + +Backport upstream commit bb07009c4f62dd2ac393aab82fded6424eead82f +to ignore ignore possible empty lines. + +--- rt.py.orig 2018-07-16 12:47:27.000000000 +0000 ++++ rt.py +@@ -518,15 +518,19 @@ class Rt: + return items + elif Format == 's': + items = [] +- msgs = msg.splitlines()[2:] ++ msgs = lines[2:] + for msg in msgs: ++ if "" == msg: # Ignore blank line at the end ++ continue + ticket_id, subject = msg.split(': ', 1) + items.append({'id': 'ticket/' + ticket_id, 'Subject': subject}) + return items + elif Format == 'i': + items = [] +- msgs = msg.splitlines()[2:] ++ msgs = lines[2:] + for msg in msgs: ++ if "" == msg: # Ignore blank line at the end ++ continue + _, ticket_id = msg.split('/', 1) + items.append({'id': 'ticket/' + ticket_id}) + return items |