Skip to content

Commit d774539

Browse files
dbiebercopybara-github
authored andcommitted
make pytype happy w/ __str__ feature.
PiperOrigin-RevId: 260155248 Change-Id: Iac4795a8177df8bf9108efe916035f94507e8902
1 parent 18ba635 commit d774539

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fire/core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def _PrintResult(component_trace, verbose=False):
247247
if hasattr(result, '__str__'):
248248
# If the object has a custom __str__ method, rather than one inherited from
249249
# object, then we use that to serialize the object.
250-
class_attrs = completion.GetClassAttrsDict(type(result))
250+
class_attrs = completion.GetClassAttrsDict(type(result)) or {}
251251
str_attr = class_attrs.get('__str__')
252252
if str_attr and str_attr.defining_class is not object:
253253
print(str(result))

0 commit comments

Comments
 (0)