Skip to content

Commit

Permalink
Add nullcontext for python3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
iory committed Feb 17, 2025
1 parent daa8ae2 commit d0a60b8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion skrobot/apps/convert_urdf_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ def main():
force_visual_mesh_origin_to_zero_or_not = \
force_visual_mesh_origin_to_zero
else:
force_visual_mesh_origin_to_zero_or_not = contextlib.nullcontext
try:
from contextlib import nullcontext
except ImportError:
# for python3.6
@contextlib.contextmanager
def nullcontext(enter_result=None):
yield enter_result
force_visual_mesh_origin_to_zero_or_not = nullcontext

r = RobotModel()
with open(base_path / urdf_path) as f:
Expand Down

0 comments on commit d0a60b8

Please sign in to comment.