Skip to content

Commit

Permalink
Attempt to fix the python test on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
GiulioRomualdi committed Mar 29, 2022
1 parent 0534c8f commit 58496c5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/icub_models/icub_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@
# @authors Giulio Romualdi
# @copyright 2022 Istituto Italiano di Tecnologia Released under the terms of the Creative Commons Attribution Share Alike 4.0 International

import os
import pathlib
from typing import List


def get_models_path() -> pathlib.Path:
root = ""
relative_path = "@ICUB_MODELS_CXX_PYTHON_INSTALL_RELATIVE_DIR@"
# If relative_path starts with @, it is a not escaped string
# from CMake, i.e. that means that the file was installed via setup.py
# let's substitute relative_path with its default value
if relative_path.startswith("@"):
root = pathlib.Path(__file__).parent.parent.parent.parent.parent
# This is required to handle the difference between the unix and
# windows folder structure
if os.name == "nt":
root = pathlib.Path(__file__).parent.parent.parent.parent
else:
root = pathlib.Path(__file__).parent.parent.parent.parent.parent
else:
root = pathlib.Path(__file__) / relative_path

Expand Down

0 comments on commit 58496c5

Please sign in to comment.