Skip to content

Commit

Permalink
Avoid docutils.nodes.reprunicode
Browse files Browse the repository at this point in the history
`docutils.nodes.reprunicode` was until recently just a subclass of `str`. It was removed in this commit: https://sourceforge.net/p/docutils/code/9415/
Therefore `path = nodes.reprunicode(path)` just converted a string to a string and can therefore be removed.

This is an alternative to fixing `docutils` to an old version (as done in CrossNox#69).

Fixes CrossNox#68
  • Loading branch information
2xB authored Oct 15, 2024
1 parent 0408d7a commit 4408b84
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions m2r2.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from argparse import ArgumentParser, Namespace

import mistune
from docutils import io, nodes, statemachine, utils
from docutils import io, statemachine, utils
from docutils.parsers import rst
from docutils.utils import column_width
from pkg_resources import get_distribution
Expand Down Expand Up @@ -608,7 +608,6 @@ def run(self):
path = rst.directives.path(self.arguments[0])
path = os.path.normpath(os.path.join(source_dir, path))
path = utils.relative_path(None, path)
path = nodes.reprunicode(path)

# get options (currently not use directive-specific options)
encoding = self.options.get(
Expand Down

0 comments on commit 4408b84

Please sign in to comment.