From c5286cd923f7c0132c4380f481aa34546c3fcc61 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 10 Apr 2018 13:59:11 +1000 Subject: waf: Add getcwd() to sys.path as waf has changed. --- wscript | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'wscript') diff --git a/wscript b/wscript index 0a34d47..0f51f96 100644 --- a/wscript +++ b/wscript @@ -1,6 +1,6 @@ # # RTEMS Tools Project (http://www.rtems.org/) -# Copyright 2014-2015 Chris Johns (chrisj@rtems.org) +# Copyright 2014-2018 Chris Johns (chrisj@rtems.org) # All rights reserved. # # This file is part of the RTEMS Tools package in 'rtems-tools'. @@ -50,7 +50,18 @@ def get_version(ctx): v.read('VERSION') release = v.get('version', 'release') else: - from rtemstoolkit import git + # + # waf after 1.9.9 does not place the current directory in Python's + # system path which means importing the RTEMS toolkit + # fails. Temporarily add it so we can import the git module. + # + import sys + current_sys_path = sys.path + try: + sys.path = [os.getcwd()] + sys.path + from rtemstoolkit import git + finally: + sys.path = current_sys_path repo = git.repo('.') if repo.valid(): head = repo.head() -- cgit v1.2.3