Maybe N_RETRIES can be used diirectly in _retry_method and not passed as an argument since it's always set to the configuration value. Also, you should access the value of ``N_RETRIES`` using ``N_RETRIES()``