From 42f436d609a5e35555051657371d995890c42a95 Mon Sep 17 00:00:00 2001 From: Ben Dyer Date: Fri, 3 Apr 2015 00:43:11 +1100 Subject: [PATCH] Prepend pyuavcan in source directory to sys.path When running from the source directory, libuavcan_dsdlc should use the version of pyuavcan in the source directory instead of a globally installed version of pyuavcan. Fixes UAVCAN/uavcan#18 --- libuavcan/dsdl_compiler/libuavcan_dsdlc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdlc b/libuavcan/dsdl_compiler/libuavcan_dsdlc index 7f655ea2ee..043dc387b2 100755 --- a/libuavcan/dsdl_compiler/libuavcan_dsdlc +++ b/libuavcan/dsdl_compiler/libuavcan_dsdlc @@ -13,8 +13,8 @@ RUNNING_FROM_SRC_DIR = os.path.abspath(__file__).endswith(os.path.join('libuavca if RUNNING_FROM_SRC_DIR: print('Running from the source directory') scriptdir = os.path.dirname(os.path.abspath(__file__)) - sys.path.append(os.path.join(scriptdir, '..', '..', 'pyuavcan')) - sys.path.append(os.path.join(scriptdir)) + sys.path.insert(0, os.path.join(scriptdir, '..', '..', 'pyuavcan')) + sys.path.insert(0, os.path.join(scriptdir)) def configure_logging(verbosity): fmt = '%(message)s'