On Windows, if I don't pass the "menu" kwarg to pystray.Icon init function just like
icon = pystray.Icon('test name')
it will raise "TypeError: pystray._base.Menu() argument after * must be an iterable, not NoneType"
I think it is because the lack of judgement whether menu is None in the init function of class Icon in the code below.
class Icon(object):
"""..."""
def __init__(
self, name, icon=None, title=None, menu=None, **kwargs):
self._name = name
self._icon = icon or None
self._title = title or ''
self._menu = menu if isinstance(menu, Menu) else Menu(*menu) # <-- should be "isinstance(menu, Menu) or menu is None"
self._visible = False
self._icon_valid = False
self._log = logging.getLogger(__name__)
On Windows, if I don't pass the "menu" kwarg to pystray.Icon init function just like
it will raise "TypeError: pystray._base.Menu() argument after * must be an iterable, not NoneType"
I think it is because the lack of judgement whether menu is None in the init function of class Icon in the code below.