Skip to content

Commit 03464d9

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

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

git/objects/commit.py

Lines 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy