diff options
author | Brad King <brad.king@kitware.com> | 2020-03-06 14:42:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-06 14:42:20 (GMT) |
commit | 41162cbb81401c42578ca794ad6fd01aebc109c5 (patch) | |
tree | c85462079f046c0a8d4fb05929d3ff223792d3c9 /Source | |
parent | 3665d27c124a3960d0168a6e31257f98fab01129 (diff) | |
parent | 98e735903a031d0285389171c7f049bfe3e26286 (diff) | |
download | CMake-41162cbb81401c42578ca794ad6fd01aebc109c5.zip CMake-41162cbb81401c42578ca794ad6fd01aebc109c5.tar.gz CMake-41162cbb81401c42578ca794ad6fd01aebc109c5.tar.bz2 |
Merge topic 'ConvertMSBuildXMLToJSON-default-mutable'
98e735903a MSBuild: Fix python mutable default data structure
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Drew Dennison <dennison@mit.edu>
Merge-request: !4432
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmConvertMSBuildXMLToJSON.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmConvertMSBuildXMLToJSON.py b/Source/cmConvertMSBuildXMLToJSON.py index 02074ba..2be3781 100644 --- a/Source/cmConvertMSBuildXMLToJSON.py +++ b/Source/cmConvertMSBuildXMLToJSON.py @@ -35,12 +35,14 @@ def vsflags(*args): return values -def read_msbuild_xml(path, values={}): +def read_msbuild_xml(path, values=None): """Reads the MS Build XML file at the path and returns its contents. Keyword arguments: values -- The map to append the contents to (default {}) """ + if values is None: + values = {} # Attempt to read the file contents try: @@ -76,12 +78,15 @@ def read_msbuild_xml(path, values={}): return values -def read_msbuild_json(path, values=[]): +def read_msbuild_json(path, values=None): """Reads the MS Build JSON file at the path and returns its contents. Keyword arguments: values -- The list to append the contents to (default []) """ + if values is None: + values = [] + if not os.path.exists(path): logging.info('Could not find MS Build JSON file at %s', path) return values |