From c5cf1ad27088e9ca430e1dadde74f3151cc9df78 Mon Sep 17 00:00:00 2001
From: VIGNET Pierre <pierre.vignet@irisa.fr>
Date: Fri, 3 Mar 2017 15:35:31 +0100
Subject: [PATCH] Fix bug in solution sort: \n was not written

---
 solution_sort.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/solution_sort.py b/solution_sort.py
index ce943a2..e97f995 100644
--- a/solution_sort.py
+++ b/solution_sort.py
@@ -10,11 +10,15 @@ def sort_solutions(file):
 
     with open(file, 'r+') as fd:
         for line in fd:
-            line = line.rstrip('\n')
             # Remove possible \t separator from first line (frontier solution)
+            line = line.rstrip('\n')
             stripped_line = line.rstrip('\t').replace('\t', ' ')
 
-            if stripped_line[0] not in ('%', '=', ' ', ''):
+            # Next line if empty line
+            if stripped_line == '':
+                continue
+
+            if stripped_line[0] not in ('%', '=', ' '):
                 # print(stripped_line)
                 # Sort in lower case, remove ' ' empty elements
                 solutions[line] = \
-- 
GitLab