]> git.ozlabs.org Git - patchwork/blobdiff - apps/patchwork/parser.py
models: fix From header in mbox view
[patchwork] / apps / patchwork / parser.py
index 24631b739822fde096f3f748343410be8ec2be3d..f4605668e67a78f9f7cbd1a5e4018251ba2caf17 100644 (file)
@@ -63,11 +63,12 @@ def parse_patch(text):
     lc = (0, 0)
     hunk = 0
 
-    for line in text.decode('utf-8').split('\n'):
+
+    for line in text.split('\n'):
         line += '\n'
 
         if state == 0:
-            if line.startswith('diff') or line.startswith('===') \
+            if line.startswith('diff ') or line.startswith('===') \
                     or line.startswith('Index: '):
                 state = 1
                 buf += line