Skip to content

Commit

Permalink
Update CommandError._msg documentation
Browse files Browse the repository at this point in the history
This converts it from a specially formatted comment to a docstring
(gitpython-developers#1734), rewords for clarity, and removes the mention of unicode,
which appears to have been referring to the data type.

(GitPython no longer supports Python 2, and unicode is not a
separate type from str in Python 3, where instead str and bytes
are different types.)
  • Loading branch information
EliahKagan committed Feb 26, 2024
1 parent ba878ef commit 3958747
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions git/exc.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,13 @@ class CommandError(GitError):
A non-empty list of argv comprising the command-line.
"""

#: A unicode print-format with 2 `%s for `<cmdline>` and the rest,
#: e.g.
#: "'%s' failed%s"
_msg = "Cmd('%s') failed%s"
"""Format string with 2 ``%s`` for ``<cmdline>`` and the rest.
For example: ``"'%s' failed%s"``
Subclasses may override this attribute, provided it is still in this form.
"""

def __init__(
self,
Expand Down

0 comments on commit 3958747

Please sign in to comment.