FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-119050: Add XML support to libregrtest refleak checker by vstinner · Pull Request #119148 · python/cpython · GitHub

/ cpython Public
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Use pickle to serialize
  • Loading branch information
vstinner committed May 18, 2024
commit 0eb1be31613b07962ee7bbcdedf82fc39cf36d02
14 changes: 6 additions & 8 deletions Lib/test/libregrtest/refleak.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,21 @@ def save_support_xml(filename):
if support.junit_xml_list is None:
return

with open(filename, 'x', encoding='ascii') as fp:
for elem in support.junit_xml_list:
print(elem, file=fp)
import pickle
with open(filename, 'xb') as fp:
pickle.dump(support.junit_xml_list, fp)
support.junit_xml_list = None


def restore_support_xml(filename):
try:
fp = open(filename, 'r', encoding='ascii')
fp = open(filename, 'rb')
except FileNotFoundError:
return

xml_list = []
import pickle
with fp:
for line in fp:
line = line.rstrip()
xml_list.append(line)
xml_list = pickle.load(fp)
os.unlink(filename)

support.junit_xml_list = xml_list
Expand Down

Back | FazBrowse Home | New Git URL