From: Arnaud Giersch Date: Sat, 14 Jul 2018 19:59:28 +0000 (+0200) Subject: Change order of exceptions to please pylint (codacy). X-Git-Tag: v3_21~427 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9ae420c91ae08cfe23ee704b944d2a60412c40fa?ds=sidebyside Change order of exceptions to please pylint (codacy). --- diff --git a/tools/tesh/tesh.py b/tools/tesh/tesh.py index 623940706d..59e5751d05 100755 --- a/tools/tesh/tesh.py +++ b/tools/tesh/tesh.py @@ -326,13 +326,13 @@ class Cmd(object): except OSError: # os.getpgid failed. OK. No cleanup. pass - 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 FileNotFoundError: + print("["+FileReader().filename+":"+str(self.linenumber)+"] Cannot start '"+args[0]+"': File not found") + 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)"