Skip to content

Commit c70f9d3

Browse files
sloriatirkarthi
andauthored
fix: Use ElementTree instead of deprecated cElementTree. (sloria#427)
* Use ElementTree instead of deprecated cElementTree. * Add @tirkarthi to AUTHORS; update changelog --------- Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
1 parent 411eadd commit c70f9d3

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ Contributors (chronological)
3333
- Ram Rachum `@cool-RR <https://github.com/cool-RR>`_
3434
- Romain Casati `@casatir <https://github.com/casatir>`_
3535
- Evgeny Kemerov `@sudoguy <https://github.com/sudoguy>`_
36+
- Karthikeyan Singaravelan `@tirkarthi <https://github.com/tirkarthi>`_

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Changelog
44
0.18.0 (unreleased)
55
-------------------
66

7+
Bug fixes:
8+
9+
- Remove usage of deprecated cElementTree (:issue:`339`).
10+
Thanks :user:`tirkarthi` for reporting and for the PR.
11+
- Address ``SyntaxWarning`` on Python 3.12 (:pr:`418`).
12+
Thanks :user:`smontanaro` for the PR.
13+
714
Removals:
815

916
- ``TextBlob.translate()`` and ``TextBlob.detect_language``, and ``textblob.translate``

src/textblob/_text.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import string
1010
import types
1111
from itertools import chain
12-
from xml.etree import cElementTree
12+
from xml.etree import ElementTree
1313

1414
basestring = (str, bytes)
1515

@@ -909,7 +909,7 @@ def load(self, path=None):
909909
if not os.path.exists(path):
910910
return
911911
words, synsets, labels = {}, {}, {}
912-
xml = cElementTree.parse(path)
912+
xml = ElementTree.parse(path)
913913
xml = xml.getroot()
914914
for w in xml.findall("word"):
915915
if self._confidence is None or self._confidence <= float(

0 commit comments

Comments
 (0)