src/eric7/DebugClients/Python/MultiProcessDebugExtension.py

branch
eric7-maintenance
changeset 9654
7328efba128b
parent 9653
e67609152c5e
child 10119
64147a7e6393
--- a/src/eric7/DebugClients/Python/MultiProcessDebugExtension.py	Thu Dec 01 10:18:07 2022 +0100
+++ b/src/eric7/DebugClients/Python/MultiProcessDebugExtension.py	Mon Jan 02 11:16:03 2023 +0100
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 
-# Copyright (c) 2002 - 2022 Detlev Offenbach <detlev@die-offenbachs.de>
+# Copyright (c) 2002 - 2023 Detlev Offenbach <detlev@die-offenbachs.de>
 #
 
 """
@@ -71,10 +71,9 @@
         """
         Function replacing the 'execl' functions of the os module.
         """
-        if _shallPatch():
+        if _shallPatch() and isPythonProgram(args[0]):
             args = patchArguments(_debugClient, args)
-            if isPythonProgram(args[0]):
-                path = args[0]
+            path = args[0]
         return getattr(os, originalName)(path, *args)
 
     return newExecl
@@ -99,10 +98,9 @@
         """
         Function replacing the 'execv' functions of the os module.
         """
-        if _shallPatch():
+        if _shallPatch() and isPythonProgram(args[0]):
             args = patchArguments(_debugClient, args)
-            if isPythonProgram(args[0]):
-                path = args[0]
+            path = args[0]
         return getattr(os, originalName)(path, args)
 
     return newExecv
@@ -127,10 +125,9 @@
         """
         Function replacing the 'execve' functions of the os module.
         """
-        if _shallPatch():
+        if _shallPatch() and isPythonProgram(args[0]):
             args = patchArguments(_debugClient, args)
-            if isPythonProgram(args[0]):
-                path = args[0]
+            path = args[0]
         return getattr(os, originalName)(path, args, env)
 
     return newExecve

eric ide

mercurial