Skip to content

Commit

Permalink
mp_util.py: work around imp module going away in 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker authored and tridge committed Jan 3, 2024
1 parent eacee97 commit 0a52527
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions MAVProxy/modules/lib/mp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,22 @@
# auto-detection is failing on windows, for an unknown reason
has_wxpython = True
else:
import imp
try:
imp.find_module('wx')
has_wxpython = True
except ImportError as e:
pass
import importlib
try:
import importlib.util
except ImportError:
pass

if importlib.util.find_spec('wx') is not None:
has_wxpython = True
except (ImportError, ModuleNotFoundError):
import imp
try:
imp.find_module('wx')
has_wxpython = True
except ImportError as e:
pass

radius_of_earth = 6378100.0 # in meters

Expand Down

0 comments on commit 0a52527

Please sign in to comment.