print warning log when parse attributes not defined of the object

pull/6467/head
buxue 4 years ago
parent 12f27b8a70
commit a86e4ac370

@ -18,6 +18,8 @@
import builtins
from mindspore import log as logger
class Namespace:
"""
@ -115,3 +117,6 @@ class ClassMemberNamespace(Namespace):
return d.__dict__[name]
except ValueError:
raise UnboundLocalError(name)
except KeyError:
logger.warning(f"'{d.__class__.__name__ }' object has no attribute or method: '{name}', "
f"so will return None.")

Loading…
Cancel
Save