DSDLC compiler fix for Windows - libuavcan_dsdl_compiler.pretty_filename()

This commit is contained in:
Pavel Kirienko 2014-07-25 00:48:45 +04:00
parent c0d3b3f2b0
commit f51ee9cdec

View File

@ -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