From 7e32165748de8fa044ecdfac9315825111d63f84 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Fri, 13 Jul 2018 20:11:35 +0200 Subject: [PATCH] tesh: better error reporting in one specific failure case --- tools/tesh/tesh.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index 3bc74483a5..623940706d 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -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 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)" -- 2.20.1