From f51ee9cdecd7841f6208bfb0b16228888daad663 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 25 Jul 2014 00:48:45 +0400 Subject: [PATCH] DSDLC compiler fix for Windows - libuavcan_dsdl_compiler.pretty_filename() --- .../dsdl_compiler/libuavcan_dsdl_compiler/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py index e1c100ca59..4f00e23f6f 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py @@ -64,9 +64,12 @@ def run(source_dirs, include_dirs, output_dir): # ----------------- def pretty_filename(filename): - a = os.path.abspath(filename) - r = os.path.relpath(filename) - return a if len(a) < len(r) else r + try: + a = os.path.abspath(filename) + r = os.path.relpath(filename) + return a if len(a) < len(r) else r + except ValueError: + return filename # Fails on Windows "Cannot mix UNC and non-UNC paths", investigate someday later def type_output_filename(t): assert t.category == t.CATEGORY_COMPOUND