Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change order of exceptions to please pylint (codacy).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 14 Jul 2018 19:59:28 +0000 (21:59 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 16 Jul 2018 09:55:00 +0000 (11:55 +0200)
tools/tesh/tesh.py

index 6239407..59e5751 100755 (executable)
@@ -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)"