Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify lock recipe in a post Python 3.2 threading world. #605

Closed
ceache opened this issue Apr 25, 2020 · 3 comments · Fixed by #676
Closed

Simplify lock recipe in a post Python 3.2 threading world. #605

ceache opened this issue Apr 25, 2020 · 3 comments · Fixed by #676

Comments

@ceache
Copy link
Contributor

ceache commented Apr 25, 2020

The lock recipe assumes threading.Lock.acquire() does not take a timeout argument.

# Lock acquire doesn't take a timeout, so simulate it...

https://docs.python.org/3/library/threading.html#threading.Lock.acquire

Changed in version 3.2: The timeout parameter is new.

Code can be simplified a lot now that Py2x and py3 < 3.6 support is dropped.

(Note that Gevent and Eventlet Lock already have a timeout argument)

@StephenSorriaux
Copy link
Member

StephenSorriaux commented May 9, 2020

Do you think starting a feat/drop-python2-support branch to work on it would be a good idea?

@jeffwidman
Copy link
Member

I certainly would support simplifying this code.

I'd suggest doing it in pieces... ie, this is an obvious candidate for a PR all by itself. Doing it as a separate branch with such a broad scope of "drop all python 2 support" is a much bigger task...

a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 23, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 23, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 24, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 24, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 24, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 24, 2022
a-ungurianu added a commit to a-ungurianu/kazoo that referenced this issue Oct 28, 2022
@jeffwidman
Copy link
Member

Just wanted to say thanks @ceache and @StephenSorriaux for all the efforts that you've been landing lately, including this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants