fix the encoding problem for subprocess.check_output

This commit is contained in:
stmoon
2020-02-09 19:01:24 +09:00
committed by Nuno Marques
parent 6c76f99fe5
commit 8b273b46aa
+1 -1
View File
@@ -253,7 +253,7 @@ else:
ros2_distro = ""
try:
rosversion_out = subprocess.check_output(["rosversion", "-d"])
rosversion_out = rosversion_out.rstrip()
rosversion_out = rosversion_out.rstrip().decode('utf-8')
if rosversion_out not in ["<unknown>", "kinetic", "lunar", "melodic"]:
ros2_distro = rosversion_out
except OSError as e: