Suppress warnings when listing functions for serialization.
PiperOrigin-RevId: 342271395 Change-Id: Ieedeeb7817f794c41dae3eb06b9b0d3b607fa89a
This commit is contained in:
parent
6eee4b02a8
commit
1e548c4db7
@ -18,6 +18,7 @@ from __future__ import division
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
|
import warnings
|
||||||
|
|
||||||
from absl import logging
|
from absl import logging
|
||||||
|
|
||||||
@ -107,7 +108,9 @@ class AutoTrackable(base.Trackable):
|
|||||||
logging_verbosity = logging.get_verbosity()
|
logging_verbosity = logging.get_verbosity()
|
||||||
try:
|
try:
|
||||||
logging.set_verbosity(logging.FATAL)
|
logging.set_verbosity(logging.FATAL)
|
||||||
attribute_value = getattr(self, attribute_name, None)
|
with warnings.catch_warnings():
|
||||||
|
warnings.simplefilter("ignore")
|
||||||
|
attribute_value = getattr(self, attribute_name, None)
|
||||||
except Exception: # pylint: disable=broad-except
|
except Exception: # pylint: disable=broad-except
|
||||||
# We really don't want to throw an exception just because some object's
|
# We really don't want to throw an exception just because some object's
|
||||||
# attribute accessor is broken.
|
# attribute accessor is broken.
|
||||||
|
Loading…
Reference in New Issue
Block a user