From ec9e698dc57cde7cdbef373ceb075dd02eeb43f1 Mon Sep 17 00:00:00 2001
From: ashivani <ashivani@aicrowd.com>
Date: Tue, 8 Oct 2019 21:31:18 +0530
Subject: [PATCH] Added warning-distanc_map cannot be saved

---
 flatland/envs/rail_env.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py
index 2f6bf813..2999554d 100644
--- a/flatland/envs/rail_env.py
+++ b/flatland/envs/rail_env.py
@@ -731,11 +731,9 @@ class RailEnv(Environment):
                     with open(filename, "wb") as file_out:
                         file_out.write(self.get_full_state_dist_msg())
                 else:
-                    with open(filename, "wb") as file_out:
-                        file_out.write(self.get_full_state_msg())
+                    raise Exception("Unable to save distance map")
             else:
-                with open(filename, "wb") as file_out:
-                    file_out.write(self.get_full_state_msg())
+                raise Exception("Unable to save distance map")
         else:
             with open(filename,"wb") as file_out:
                 file_out.write(self.get_full_state_msg())
-- 
GitLab