diff --git a/mesonbuild/scripts/__init__.py b/mesonbuild/scripts/__init__.py index 476a28a87..72777713a 100644 --- a/mesonbuild/scripts/__init__.py +++ b/mesonbuild/scripts/__init__.py @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. +from pathlib import PurePath + def destdir_join(d1: str, d2: str) -> str: if not d1: return d2 # c:\destdir + c:\prefix must produce c:\destdir\prefix - if len(d2) > 1 and d2[1] == ':': - return d1 + d2[2:] - return d1 + d2 + return str(PurePath(d1, *PurePath(d2).parts[1:]))