clover: Fix importing urllib for Python3

This commit is contained in:
Alexey Rogachevskiy
2020-10-12 20:18:12 +03:00
parent ce1f1d9db5
commit 1893f0528b

View File

@@ -26,8 +26,13 @@ def test_simple_offboard_services_available():
rospy.wait_for_service('land', timeout=5)
def test_web_video_server(node):
import urllib2
urllib2.urlopen("http://localhost:8080").read()
try:
# Python 2
import urllib2 as urllib
except ModuleNotFoundError:
# Python 3
import urllib.request as urllib
urllib.urlopen("http://localhost:8080").read()
def test_shell(node):
execute = rospy.ServiceProxy('exec', srv.Execute)