gvalkov / python-evdev

Python bindings for the Linux input subsystem
https://python-evdev.rtfd.org/
BSD 3-Clause "New" or "Revised" License
334 stars 112 forks source link

fix ImportError: sys.meta_path is None #154

Closed luizoti closed 2 years ago

luizoti commented 3 years ago

Fix ImportError, AttributeError, maybe a generic Exception is more pratical

Exception ignored in: <bound method InputDevice.__del__ of InputDevice('/dev/input/event12')>
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/evdev/device.py", line 160, in __del__
  File "/usr/local/lib/python3.6/dist-packages/evdev/device.py", line 305, in close
  File "/usr/local/lib/python3.6/dist-packages/evdev/eventio_async.py", line 55, in close
  File "/usr/lib/python3.6/asyncio/events.py", line 694, in get_event_loop
  File "/usr/lib/python3.6/asyncio/events.py", line 669, in get_event_loop_policy
  File "/usr/lib/python3.6/asyncio/events.py", line 662, in _init_event_loop_policy
ImportError: sys.meta_path is None, Python is likely shutting down
gvalkov commented 2 years ago

Thanks!