Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski authored Oct 18, 2024
1 parent df016c8 commit 31c64a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyhockeystats/hockeyfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1620,9 +1620,9 @@ def BeautifyXMLCode(inxmlfile, xmlisfile=True, indent="\t", newl="\n", encoding=
# If it's a file, read and parse it
if re.findall("^(http|https|ftp|ftps|sftp)\\:\\/\\/", inxmlfile):
inxmlfile = UncompressFileURL(inxmlfile)
tree = ET.parse(inxmlfile)
tree = cElementTree.parse(inxmlfile)
else:
tree = ET.parse(UncompressFile(inxmlfile))
tree = cElementTree.parse(UncompressFile(inxmlfile))
else:
# If it's a string, parse it
chckcompression = CheckCompressionTypeFromString(inxmlfile)
Expand All @@ -1634,7 +1634,7 @@ def BeautifyXMLCode(inxmlfile, xmlisfile=True, indent="\t", newl="\n", encoding=
except TypeError:
inxmlfile = BytesIO(inxmlfile)
inxmlfile = UncompressFile(inxmlfile)
tree = ET.ElementTree(ET.fromstring(inxmlfile.read()))
tree = cElementTree.ElementTree(cElementTree.fromstring(inxmlfile.read()))

# Get the root element
root = tree.getroot()
Expand All @@ -1644,7 +1644,7 @@ def BeautifyXMLCode(inxmlfile, xmlisfile=True, indent="\t", newl="\n", encoding=
RemoveBlanks(root)

# Convert the ElementTree back to string
rough_string = ET.tostring(root, encoding=encoding, method="xml")
rough_string = cElementTree.tostring(root, encoding=encoding, method="xml")

if isinstance(rough_string, bytes):
rough_string = rough_string.decode(encoding)
Expand Down

0 comments on commit 31c64a8

Please sign in to comment.