From cc6929a88ee7c5cc24155065a0920deff1ff085e Mon Sep 17 00:00:00 2001
From: Robin Mueller <robin.mueller.m@gmail.com>
Date: Wed, 2 Dec 2020 22:41:08 +0100
Subject: [PATCH] removed obsolete block

---
 config/tmtcc_com_config.py | 30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/config/tmtcc_com_config.py b/config/tmtcc_com_config.py
index e240e2e..0132f73 100644
--- a/config/tmtcc_com_config.py
+++ b/config/tmtcc_com_config.py
@@ -70,23 +70,21 @@ def set_communication_interface(tmtc_printer: TmTcPrinter) -> Union[Communicatio
 def determine_com_port() -> str:
     reconfigure_com_port = False
     com_port = ""
-    if g.G_COM_PORT is None:
-        if os.path.isfile("config/tmtcc_config.json"):
-            with open("config/tmtcc_config.json", "r") as write:
-                load_data = json.load(write)
-                com_port = load_data["COM_PORT"]
-                if not check_port_validity(com_port):
-                    reconfigure = input(
-                        "COM port from configuration file not contained within serial"
-                        "port list. Reconfigure serial port? [y/n]: ")
-                    if reconfigure.lower() in ['y', "yes"]:
-                        write.close()
-                        os.remove("config/tmtcc_config.json")
-                        reconfigure_com_port = True
-        else:
-            reconfigure_com_port = True
+
+    if os.path.isfile("config/tmtcc_config.json"):
+        with open("config/tmtcc_config.json", "r") as write:
+            load_data = json.load(write)
+            com_port = load_data["COM_PORT"]
+            if not check_port_validity(com_port):
+                reconfigure = input(
+                    "COM port from configuration file not contained within serial"
+                    "port list. Reconfigure serial port? [y/n]: ")
+                if reconfigure.lower() in ['y', "yes"]:
+                    write.close()
+                    os.remove("config/tmtcc_config.json")
+                    reconfigure_com_port = True
     else:
-        com_port = g.G_COM_PORT
+        reconfigure_com_port = True
 
     if reconfigure_com_port:
         com_port = prompt_com_port()
-- 
GitLab