Remove workarounds and backports for Python 2 support

In particular:
- In common/, remove the backport of weakref.WeakMethod
- In docs/ and ui/, use the standard FileNotFoundError class
- Use built-in open() instead of io.open(), and stop importing io
- In core/stats.py, use the standard implementation of xml.etree instead
of the C one
This commit is contained in:
Candice Bentéjac 2022-12-05 16:34:01 +01:00
parent 635f85e7fd
commit 8bef398bed
9 changed files with 10 additions and 88 deletions

View file

@ -17,12 +17,6 @@ from docutils.nodes import SparseNodeVisitor
from docutils.parsers.rst import Directive
from utils import md_to_docutils, get_link_key
# Python2 compatibility
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
class Relinker(SparseNodeVisitor):