Skip to content

Commit

Permalink
make pytype happy w/ __str__ feature.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 260155248
Change-Id: Iac4795a8177df8bf9108efe916035f94507e8902
  • Loading branch information
dbieber authored and copybara-github committed Jul 26, 2019
1 parent 18ba635 commit d774539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fire/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _PrintResult(component_trace, verbose=False):
if hasattr(result, '__str__'):
# If the object has a custom __str__ method, rather than one inherited from
# object, then we use that to serialize the object.
class_attrs = completion.GetClassAttrsDict(type(result))
class_attrs = completion.GetClassAttrsDict(type(result)) or {}
str_attr = class_attrs.get('__str__')
if str_attr and str_attr.defining_class is not object:
print(str(result))
Expand Down

0 comments on commit d774539

Please sign in to comment.