diff --git a/hb/common/config.py b/hb/common/config.py index e07d7154a4bd3e74dd653822feab51c1c467d7a9..26813a8c17218770b8ab10c693d8cf7902badd81 100755 --- a/hb/common/config.py +++ b/hb/common/config.py @@ -128,7 +128,10 @@ class Config(metaclass=Singleton): @property def build_path(self): - return os.path.join(self.root_path, 'build', 'lite') + _build_path = os.path.join(self.root_path, 'build', 'lite') + if not os.path.isdir(_build_path): + raise Exception(f'Invalid build path: {_build_path}') + return _build_path @property def out_path(self): @@ -144,7 +147,10 @@ class Config(metaclass=Singleton): @property def vendor_path(self): - return os.path.join(self.root_path, 'vendor') + _vendor_path = os.path.join(self.root_path, 'vendor') + if not os.path.isdir(_vendor_path): + raise Exception(f'Invalid vendor path: {_vendor_path}') + return _vendor_path @property def build_tools_path(self): diff --git a/hb/common/utils.py b/hb/common/utils.py index c22f05fe6f6b00c197d0dcdddf38bf175d91ab30..a3ba0f6988092ae2c6ee27b73ab7df7b48c94720 100755 --- a/hb/common/utils.py +++ b/hb/common/utils.py @@ -169,21 +169,21 @@ def args_factory(args_dict): def hb_info(msg): level = 'info' - for line in msg.splitlines(): + for line in str(msg).splitlines(): sys.stdout.write(message(level, line)) sys.stdout.flush() def hb_warning(msg): level = 'warning' - for line in msg.splitlines(): + for line in str(msg).splitlines(): sys.stderr.write(message(level, line)) sys.stderr.flush() def hb_error(msg): level = 'error' - for line in msg.splitlines(): + for line in str(msg).splitlines(): sys.stderr.write(message(level, line)) sys.stderr.flush()