python_dynamodb_lock
python_dynamodb_lock copied to clipboard
fix: support a timeout of size 0
Instances of the timedelta class with all zeros are considered Falsey. This behavior causes python-dynamodb-lock to fall back to the default retry_period and retry_timeout not only if those parameters are passed None but also if passed a blank (or zero) timedelta. It seems to me that this is not the expected result and this PR checks against None explicitly to allow for the use case where a user might want to only acquire the lock if available immediately.