Skip to content

Commit e3381e1

Browse files
committed
Redo rospy check with message instead of exception
1 parent 233a1c6 commit e3381e1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/RobotOS.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ function __init__()
3131
try
3232
copy!(__rospy__, pyimport("rospy"))
3333
catch ex
34-
if (isa(ex, PyCall.PyError) &&
35-
pycall(pybuiltin("str"), PyAny, ex.val) == "No module named rospy")
36-
error("rospy not found!\nHas an environment setup script been run?")
34+
if (isa(ex, PyCall.PyError) && ex.T.__name__ == "ModuleNotFoundError")
35+
@error """
36+
Unable to load the 'rospy' python package!
37+
Has an environment setup script been run?
38+
"""
3739
else
3840
rethrow(ex)
3941
end

0 commit comments

Comments
 (0)