Skip to content

Commit

Permalink
encoding: add deprecation warning to tools_encdec
Browse files Browse the repository at this point in the history
Signed-off-by: Erik Larsson <who+github@cnackers.org>
  • Loading branch information
whooo committed Mar 25, 2024
1 parent 70a4ccc commit f52c702
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/tpm2_pytss/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
)
import yaml
import collections.abc
import warnings


class base_encdec(object):
Expand Down Expand Up @@ -825,6 +826,14 @@ class tools_encdec(base_encdec):
"""Encode TPM types in the same format as tpm2-tools
"""

def __init__(self):
warnings.warn(
"The tools_encdec class will be deprecated in the future, "
"see https://github.com/tpm2-software/tpm2-pytss/issues/557",
category=PendingDeprecationWarning,
)
super().__init__()

def encode_friendly_int_nv(self, val: TPM_FRIENDLY_INT) -> Dict[str, str]:
d = {
"friendly": str(val),
Expand Down

0 comments on commit f52c702

Please sign in to comment.