From e32f7bc96dc8db7af0c1c532e4990c9a36a12354 Mon Sep 17 00:00:00 2001 From: "Fan, ZhijuX" Date: Thu, 12 Sep 2019 16:18:27 +0800 Subject: BaseTools:change some incorrect parameter defaults BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1858 for Dict={},There are pitfalls in the way this default parameter is set and Dict is not used in functions, other functions have these two cases, I will change some incorrect parameter defaults This patch is going to fix this issue Cc: Liming Gao Cc: Bob Feng Signed-off-by: Zhiju.Fan Reviewed-by: Bob Feng --- BaseTools/Source/Python/AutoGen/GenMake.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/GenMake.py') diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/Python/AutoGen/GenMake.py index 4f85a93055..3185ebe368 100755 --- a/BaseTools/Source/Python/AutoGen/GenMake.py +++ b/BaseTools/Source/Python/AutoGen/GenMake.py @@ -205,10 +205,12 @@ class BuildFile(object): def GetRemoveDirectoryCommand(self, DirList): return [self._RD_TEMPLATE_[self._FileType] % {'dir':Dir} for Dir in DirList] - def PlaceMacro(self, Path, MacroDefinitions={}): + def PlaceMacro(self, Path, MacroDefinitions=None): if Path.startswith("$("): return Path else: + if MacroDefinitions is None: + MacroDefinitions = {} PathLength = len(Path) for MacroName in MacroDefinitions: MacroValue = MacroDefinitions[MacroName] @@ -1762,4 +1764,4 @@ def GetDependencyList(AutoGenObject, FileCache, File, ForceList, SearchPathList) # This acts like the main() function for the script, unless it is 'import'ed into another script. if __name__ == '__main__': - pass \ No newline at end of file + pass -- cgit v1.2.3