diff --git a/backoff/_sync.py b/backoff/_sync.py
index ecc592d..1c54ecc 100644
--- a/backoff/_sync.py
+++ b/backoff/_sync.py
@@ -28,11 +28,8 @@ def retry_predicate(target, wait_gen, predicate,
 
     @functools.wraps(target)
     def retry(*args, **kwargs):
-
-        # update variables from outer function args
-        nonlocal max_tries, max_time
-        max_tries = _maybe_call(max_tries)
-        max_time = _maybe_call(max_time)
+        max_tries_value = _maybe_call(max_tries)
+        max_time_value = _maybe_call(max_time)
 
         tries = 0
         start = datetime.datetime.now()
@@ -50,9 +47,9 @@ def retry_predicate(target, wait_gen, predicate,
 
             ret = target(*args, **kwargs)
             if predicate(ret):
-                max_tries_exceeded = (tries == max_tries)
+                max_tries_exceeded = (tries == max_tries_value)
                 max_time_exceeded = (max_time is not None and
-                                     elapsed >= max_time)
+                                     elapsed >= max_time_value)
 
                 if max_tries_exceeded or max_time_exceeded:
                     _call_handlers(on_giveup, **details, value=ret)
@@ -86,11 +83,8 @@ def retry_exception(target, wait_gen, exception,
 
     @functools.wraps(target)
     def retry(*args, **kwargs):
-
-        # update variables from outer function args
-        nonlocal max_tries, max_time
-        max_tries = _maybe_call(max_tries)
-        max_time = _maybe_call(max_time)
+        max_tries_value = _maybe_call(max_tries)
+        max_time_value = _maybe_call(max_time)
 
         tries = 0
         start = datetime.datetime.now()
@@ -109,9 +103,9 @@ def retry_exception(target, wait_gen, exception,
             try:
                 ret = target(*args, **kwargs)
             except exception as e:
-                max_tries_exceeded = (tries == max_tries)
+                max_tries_exceeded = (tries == max_tries_value)
                 max_time_exceeded = (max_time is not None and
-                                     elapsed >= max_time)
+                                     elapsed >= max_time_value)
 
                 if giveup(e) or max_tries_exceeded or max_time_exceeded:
                     _call_handlers(on_giveup, **details)

diff --git a/tests/test_backoff.py b/tests/test_backoff.py
index e6b3657..4e70fec 100644
--- a/tests/test_backoff.py
+++ b/tests/test_backoff.py
@@ -548,6 +548,29 @@ def test_on_exception_callable_max_tries(monkeypatch):
     assert len(log) == 3
 
 
+def test_on_exception_callable_max_tries_reads_every_time(monkeypatch):
+    monkeypatch.setattr('time.sleep', lambda x: None)
+
+    lookups = []
+    def lookup_max_tries():
+        lookups.append(True)
+        return 3
+
+    @backoff.on_exception(backoff.constant,
+                          ValueError,
+                          max_tries=lookup_max_tries)
+    def exceptor():
+        raise ValueError()
+
+    with pytest.raises(ValueError):
+        exceptor()
+
+    with pytest.raises(ValueError):
+        exceptor()
+
+    assert len(lookups) == 2
+
+
 def test_on_exception_callable_gen_kwargs():
 
     def lookup_foo():
diff --git a/tests/test_backoff_async.py b/tests/test_backoff_async.py
index d8219fd..341a6b8 100644
--- a/tests/test_backoff_async.py
+++ b/tests/test_backoff_async.py
@@ -571,6 +571,31 @@ async def test_on_exception_callable_max_tries(monkeypatch):
     assert len(log) == 3
 
 
+@pytest.mark.asyncio
+async def test_on_exception_callable_max_tries_reads_every_time(monkeypatch):
+    monkeypatch.setattr('asyncio.sleep', _await_none)
+
+    lookups = []
+    def lookup_max_tries():
+        lookups.append(True)
+        return 3
+
+    @backoff.on_exception(backoff.constant,
+                          ValueError,
+                          max_tries=lookup_max_tries)
+    def exceptor():
+        raise ValueError()
+
+    with pytest.raises(ValueError):
+        exceptor()
+
+    with pytest.raises(ValueError):
+        exceptor()
+
+    assert len(lookups) == 2
+
+
+
 @pytest.mark.asyncio
 async def test_on_exception_callable_gen_kwargs():
 

Behavior change when reading max_tries and max_time from callables
Hi there!

Using a callable to read `max_tries` and `max_time` was really useful to query an application config object.
Every time the function was called, the value would be read again and so it remained configurable. 

After updating to version 2+, we realized that the `max_tries` and `max_time` are read from the callable once and then cached for every other usage of the function. We saw this when some unit tests that were testing that the application reloads the config correctly were broken.

This was really an use case for us and we're pinned to the previous version we had as we cannot recreate every other object that has a decorated function on every config reload and so we'd consider this a regression on this nice functionality :)

```diff
-backoff==1.10.0
+backoff==2.0.1
```

This minimal example reproduces the problem, the output shows the difference when running in those two versions:

```python
import backoff


CONFIG = {'max_tries': 1}


def _from_config():
    print('Reading max_tries: ', CONFIG)
    return CONFIG['max_tries']


@backoff.on_exception(
    backoff.expo,
    Exception,
    max_tries=_from_config,
    on_giveup=lambda details: print('Total tries', details['tries']),
)
def function():
    print('Calling function')
    raise Exception(f'boom!')


print('First attempt', CONFIG)
try:
    function()
except:
    pass

print('----')
CONFIG['max_tries'] = 2  # Config changed

print('Second attempt', CONFIG)
try:
    function()
except:
    pass
```

The output for `1.10.0` shows that the configuration is read again on every function call:

```
First attempt {'max_tries': 1}
Reading max_tries:  {'max_tries': 1}
Calling function
Total tries 1
----
Second attempt {'max_tries': 2}
Reading max_tries:  {'max_tries': 2}
Calling function
Calling function
Total tries 2
```

While on `2.0.1` this is only made once and then cached for every other execution:

```
First attempt {'max_tries': 1}
Reading max_tries:  {'max_tries': 1}
Calling function
Total tries 1
----
Second attempt {'max_tries': 2}
Calling function
Total tries 1
```

As you can see, the second time the function already cached the `max_tries` and does not read it again. 

tests/test_backoff.py::test_on_exception_callable_max_tries_reads_every_time tests/test_backoff_async.py::test_on_exception_callable_max_tries_reads_every_time
tests/test_backoff.py::test_on_predicate tests/test_backoff.py::test_on_predicate_max_tries tests/test_backoff.py::test_on_predicate_max_time tests/test_backoff.py::test_on_exception tests/test_backoff.py::test_on_exception_tuple tests/test_backoff.py::test_on_exception_max_tries tests/test_backoff.py::test_on_exception_constant_iterable tests/test_backoff.py::test_on_exception_success_random_jitter tests/test_backoff.py::test_on_exception_success_full_jitter tests/test_backoff.py::test_on_exception_success tests/test_backoff.py::test_on_exception_giveup[True] tests/test_backoff.py::test_on_exception_giveup[False] tests/test_backoff.py::test_on_exception_giveup_predicate tests/test_backoff.py::test_on_predicate_success tests/test_backoff.py::test_on_predicate_giveup tests/test_backoff.py::test_on_predicate_iterable_handlers tests/test_backoff.py::test_on_exception_success_0_arg_jitter tests/test_backoff.py::test_on_predicate_success_0_arg_jitter tests/test_backoff.py::test_on_exception_callable_max_tries tests/test_backoff.py::test_on_exception_callable_gen_kwargs tests/test_backoff.py::test_on_predicate_in_thread tests/test_backoff.py::test_on_predicate_constant_iterable tests/test_backoff.py::test_on_exception_in_thread tests/test_backoff.py::test_on_exception_logger_default tests/test_backoff.py::test_on_exception_logger_none tests/test_backoff.py::test_on_exception_logger_user tests/test_backoff.py::test_on_exception_logger_user_str tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-10-10] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-10-10] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-10-20] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-10-20] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-10-30] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-10-30] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-10-40] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-10-40] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-10-50] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-10-50] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-20-10] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-20-10] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-20-20] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-20-20] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-20-30] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-20-30] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-20-40] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-20-40] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-20-50] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-20-50] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-30-10] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-30-10] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-30-20] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-30-20] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-30-30] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-30-30] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-30-40] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-30-40] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-30-50] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-30-50] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-40-10] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-40-10] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-40-20] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-40-20] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-40-30] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-40-30] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-40-40] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-40-40] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-40-50] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-40-50] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-50-10] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-50-10] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-50-20] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-50-20] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-50-30] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-50-30] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-50-40] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-50-40] tests/test_backoff.py::test_event_log_levels[_on_predicate_factory-50-50] tests/test_backoff.py::test_event_log_levels[_on_exception_factory-50-50] tests/test_backoff_async.py::test_on_predicate tests/test_backoff_async.py::test_on_predicate_max_tries tests/test_backoff_async.py::test_on_exception tests/test_backoff_async.py::test_on_exception_tuple tests/test_backoff_async.py::test_on_exception_max_tries tests/test_backoff_async.py::test_on_exception_constant_iterable tests/test_backoff_async.py::test_on_exception_success_random_jitter tests/test_backoff_async.py::test_on_exception_success_full_jitter tests/test_backoff_async.py::test_on_exception_success tests/test_backoff_async.py::test_on_exception_giveup[True] tests/test_backoff_async.py::test_on_exception_giveup[False] tests/test_backoff_async.py::test_on_exception_giveup_predicate tests/test_backoff_async.py::test_on_exception_giveup_coro tests/test_backoff_async.py::test_on_predicate_success tests/test_backoff_async.py::test_on_predicate_giveup tests/test_backoff_async.py::test_on_predicate_iterable_handlers tests/test_backoff_async.py::test_on_predicate_constant_iterable tests/test_backoff_async.py::test_on_exception_success_0_arg_jitter tests/test_backoff_async.py::test_on_predicate_success_0_arg_jitter tests/test_backoff_async.py::test_on_exception_callable_max_tries tests/test_backoff_async.py::test_on_exception_callable_gen_kwargs tests/test_backoff_async.py::test_on_exception_coro_cancelling tests/test_backoff_async.py::test_on_predicate_on_regular_function_without_event_loop tests/test_backoff_async.py::test_on_exception_on_regular_function_without_event_loop