]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/parser.py
tox: Add tox.ini file
[patchwork] / apps / patchwork / parser.py
index 82959803adad45e8de0ee768ddd8e8c534cf1ca1..a51a7b609af0c1df36a85f0d9fac4670efd9322e 100644 (file)
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 #
 # Patchwork - automated patch tracking system
 # Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
@@ -126,6 +126,11 @@ def parse_patch(text):
                 buf = ''
                 state = 2
 
+            elif hunk and line.startswith('\ No newline at end of file'):
+                # If we had a hunk and now we see this, it's part of the patch,
+                # and we're still expecting another @@ line.
+                patchbuf += line
+
             elif hunk:
                 state = 1
                 buf += line