sherlock icon indicating copy to clipboard operation
sherlock copied to clipboard

`timeout=0` doesn't work

Open violuke opened this issue 3 years ago • 0 comments

Firstly, thanks for the great package

I wanted to set timeout=0 to effectively have just one attempt to get the lock, but the code is as follows:

        if kwargs.get('timeout'):
            self.timeout = kwargs['timeout']
        else:
            self.timeout = _configuration.timeout

And so the 0 is Falsey and it instead uses _configuration.timeout when it shouldn't.

I'd suggest this be changed to:

        if 'timeout' in kwargs:
            self.timeout = kwargs['timeout']
        else:
            self.timeout = _configuration.timeout

Thanks.

violuke avatar Sep 15 '22 09:09 violuke