Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rosidl_generator_py/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<exec_depend>rosidl_generator_c</exec_depend>
<exec_depend>rosidl_parser</exec_depend>
<exec_depend>rosidl_runtime_c</exec_depend>
<exec_depend>rpyutils</exec_depend>

<test_depend>ament_cmake_pytest</test_depend>
<test_depend>ament_index_python</test_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

import importlib

from rpyutils import add_dll_directories_from_env


class UnsupportedTypeSupport(Exception):
"""Raised when typesupport couldn't be imported."""
Expand All @@ -37,6 +39,10 @@ def import_type_support(pkg_name):
"""
module_name = '.{}_s__rosidl_typesupport_c'.format(pkg_name)
try:
return importlib.import_module(module_name, package=pkg_name)
# Since Python 3.8, on Windows we should ensure DLL directories are explicitly added
# to the search path.
# See https://docs.python.org/3/whatsnew/3.8.html#bpo-36085-whatsnew
with add_dll_directories_from_env('PATH'):
return importlib.import_module(module_name, package=pkg_name)
except ImportError:
raise UnsupportedTypeSupport(pkg_name)