Browse Source

print warning log when parse attributes not defined of the object

tags/v1.0.0
buxue 5 years ago
parent
commit
a86e4ac370
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      mindspore/_extends/parse/namespace.py

+ 5
- 0
mindspore/_extends/parse/namespace.py View File

@@ -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