Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 03464d9

Browse filesBrowse files
committed
Have the deprecated Commit.trailers property issue a warning
1 parent 2c52696 commit 03464d9
Copy full SHA for 03464d9

File tree

1 file changed

+6
-0
lines changed
Filter options

1 file changed

+6
-0
lines changed

‎git/objects/commit.py

Copy file name to clipboardExpand all lines: git/objects/commit.py
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from subprocess import Popen, PIPE
1515
import sys
1616
from time import altzone, daylight, localtime, time, timezone
17+
import warnings
1718

1819
from gitdb import IStream
1920

@@ -399,6 +400,11 @@ def trailers(self) -> Dict[str, str]:
399400
Dictionary containing whitespace stripped trailer information.
400401
Only contains the latest instance of each trailer key.
401402
"""
403+
warnings.warn(
404+
"Commit.trailers is deprecated, use Commit.trailers_list or Commit.trailers_dict instead",
405+
DeprecationWarning,
406+
stacklevel=2,
407+
)
402408
return {k: v[0] for k, v in self.trailers_dict.items()}
403409

404410
@property

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.