File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1521,7 +1521,10 @@ def _mode_mapping_bynumber(self):
15211521 return mavutil .mode_mapping_bynumber (self ._vehicle_type )
15221522
15231523 def _is_mode_available (self , mode_code ):
1524- return mode_code in self ._mode_mapping_bynumber
1524+ try :
1525+ return mode_code in self ._mode_mapping_bynumber
1526+ except :
1527+ return False
15251528
15261529 #
15271530 # Operations to support the standard API.
Original file line number Diff line number Diff line change 1+ """
2+ Simple test to trigger a bug in Vehicle class: issue #610 fixed in PR #611
3+ """
4+
5+ import time
6+ import sys
7+ import os
8+ from dronekit import connect , VehicleMode
9+ from dronekit .test import with_sitl
10+ from nose .tools import assert_equals
11+
12+ @with_sitl
13+ def test_timeout (connpath ):
14+ v = connect (connpath )
15+
16+ # Set the vehicle and autopilot type to 'unsupported' types that MissionPlanner uses as of 17.Apr.2016
17+ v ._vehicle_type = 6
18+ v ._autopilot_type = 8
19+
20+ # The above types trigger 'TypeError: argument of type 'NoneType' is not iterable' which is addressed in issue #610
21+ is_available = v ._is_mode_available (0 )
22+
23+ v .close ()
You can’t perform that action at this time.
0 commit comments