[PATCH] D107312: [analyzer] Fix deprecated plistlib functions
Manas Gupta via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 2 14:34:50 PDT 2021
manas created this revision.
Herald added subscribers: steakhal, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, mikhail.ramalho, a.sidorin, szepet, baloghadamsoftware, xazax.hun.
Herald added a reviewer: teemperor.
manas requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
It replaces the usage of readPlist,writePlist functions with load,dump
in plistlib package.
This fixes deprecation issues when analyzer reports are being generated
outside of docker.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107312
Files:
clang/utils/analyzer/SATestBuild.py
Index: clang/utils/analyzer/SATestBuild.py
===================================================================
--- clang/utils/analyzer/SATestBuild.py
+++ clang/utils/analyzer/SATestBuild.py
@@ -847,7 +847,8 @@
continue
plist = os.path.join(dir_path, filename)
- data = plistlib.readPlist(plist)
+ with open(plist, "rb") as plist_file:
+ data = plistlib.load(plist_file)
path_prefix = directory
if build_mode == 1:
@@ -866,7 +867,8 @@
if 'clang_version' in data:
data.pop('clang_version')
- plistlib.writePlist(data, plist)
+ with open(plist, "wb") as plist_file:
+ plistlib.dump(data, plist_file)
def get_build_log_path(output_dir: str) -> str:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107312.363579.patch
Type: text/x-patch
Size: 817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210802/5a481fbf/attachment-0001.bin>
More information about the cfe-commits
mailing list