diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-04-23 16:47:22 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2020-04-23 16:47:22 (GMT) |
commit | d837f8b6fb30c34e167c35f7e85ac3b7b19adccf (patch) | |
tree | 019af81ce98a755600df6a5b83efcfd312797961 /Source/cmConvertMSBuildXMLToJSON.py | |
parent | b45976fe104902ed7f0495e0e4c822684a4455e7 (diff) | |
parent | 61ac8e6dfa06d82ff2ef3ae3f0076fb9aa65d542 (diff) | |
download | CMake-d837f8b6fb30c34e167c35f7e85ac3b7b19adccf.zip CMake-d837f8b6fb30c34e167c35f7e85ac3b7b19adccf.tar.gz CMake-d837f8b6fb30c34e167c35f7e85ac3b7b19adccf.tar.bz2 |
Merge branch 'master' into ninja-order-only-fix
Diffstat (limited to 'Source/cmConvertMSBuildXMLToJSON.py')
-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 |