Skip to content

fire.Fire(func) means that func cannot return an empty dict #4

@ubershmekel

Description

@ubershmekel
import fire

def x():
    return {}

fire.Fire(x)

Will cause this stack trace:

Traceback (most recent call last):
  File "E:/1stuff/Dropbox/dev/python/testfire/testing.py", line 7, in <module>
    z = fire.Fire(x)
  File "C:\Users\yuv\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fire\core.py", line 145, in Fire
    _PrintResult(component_trace, verbose=component_trace.verbose)
  File "C:\Users\yuv\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fire\core.py", line 181, in _PrintResult
    print(_DictAsString(result, verbose))
  File "C:\Users\yuv\AppData\Local\Programs\Python\Python36-32\lib\site-packages\fire\core.py", line 201, in _DictAsString
    len(str(key)) for key in result.keys()
ValueError: max() arg is an empty sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions