Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
tesh: better error reporting in one specific failure case
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 13 Jul 2018 18:11:35 +0000 (20:11 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 13 Jul 2018 18:20:59 +0000 (20:20 +0200)
tools/tesh/tesh.py

index 3bc7448..6239407 100755 (executable)
@@ -329,6 +329,10 @@ class Cmd(object):
         except FileNotFoundError:
             print("["+FileReader().filename+":"+str(self.linenumber)+"] Cannot start '"+args[0]+"': File not found")
             tesh_exit(3)
         except FileNotFoundError:
             print("["+FileReader().filename+":"+str(self.linenumber)+"] Cannot start '"+args[0]+"': File not found")
             tesh_exit(3)
+        except NotADirectoryError:
+            print("["+FileReader().filename+":"+str(self.linenumber)+"] Cannot start '"+args[0]+"': The path to binary does not exist.")
+            print("["+FileReader().filename+":"+str(self.linenumber)+"] Current dir: "+os.getcwd())
+            tesh_exit(3)
         except OSError as osE:
             if osE.errno == 8:
                 osE.strerror += "\nOSError: [Errno 8] Executed scripts should start with shebang line (like #!/usr/bin/env sh)"
         except OSError as osE:
             if osE.errno == 8:
                 osE.strerror += "\nOSError: [Errno 8] Executed scripts should start with shebang line (like #!/usr/bin/env sh)"