File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
manager/libs/applications/compatibility Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ def __init__(self, update_callback):
2828 self .start_console ()
2929 self .user_process = None
3030 self .entrypoint_path = None
31+ self .python_command = "python"
32+ self .check_python_version ()
3133
3234 def _create_process (self , cmd ):
3335 #print("creando procesos")
@@ -45,7 +47,7 @@ def load_code(self, path: str):
4547 self .entrypoint_path = path
4648
4749 def run (self ):
48- self .user_process = self ._create_process (f"DISPLAY=:2 python { self .entrypoint_path } " )
50+ self .user_process = self ._create_process (f"DISPLAY=:2 { self . python_command } { self .entrypoint_path } " )
4951 self .running = True
5052
5153 def stop (self ):
@@ -94,4 +96,12 @@ def suspend_resume(self, signal):
9496 if (signal == "resume" ):
9597 p .resume ()
9698 except psutil .NoSuchProcess :
97- pass
99+ pass
100+
101+ def check_python_version (self ):
102+ output = subprocess .check_output (['bash' , '-c' , 'echo $ROS_VERSION' ])
103+ output_str = output .decode ('utf-8' )
104+ if (output_str == 1 ):
105+ self .python_command = "python"
106+ else :
107+ self .python_command = "python3"
You can’t perform that action at this time.
0 commit comments