kivy / kivy

Open source UI framework written in Python, running on Windows, Linux, macOS, Android and iOS
https://kivy.org
MIT License
17k stars 3.04k forks source link

Fix `xsel` import when clipboard is empty, and add timeout failsafe #8682

Closed clayote closed 3 weeks ago

clayote commented 4 weeks ago

My Kivy installation was hanging on import, and it turned out to be because xsel wasn't sending anything through its pipe -- because the selection was empty. It looked like xsel only got called to make sure it was there, so I added a --version argument, which will return something with 0 exit code if xsel is available.

I also added a timeout to the subprocess, because it seems bad that kivy just hangs when the subprocess does. If xsel is broken, Kivy should just use another clipboard provider, rather than locking up.

I removed the bare except because it did nothing.