moses-palmer / pynput

Sends virtual input commands
GNU Lesser General Public License v3.0
1.79k stars 248 forks source link

Eagerly import symbols on import instead of resolving at runtime #411

Closed ronaldoussoren closed 3 years ago

ronaldoussoren commented 3 years ago

This avoids a race condition in the lazy importer in PyObjC 7 or earlier, which might result in AttributeErrors when getting the same unresolved attribute on two threads at the same time.

This should fix #55

ronaldoussoren commented 3 years ago

The PR is lightly tested, I haven't used pynput before.

moses-palmer commented 3 years ago

Thank you very much for your effort, and I apologise for this late response.

I had similar local changes, and since I have already tested them, I decided to use those instead. I have added a thank you in the release notes.