summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/build/usage.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/build/usage.rst b/docs/build/usage.rst
index 6d4f950..8684297 100644
--- a/docs/build/usage.rst
+++ b/docs/build/usage.rst
@@ -227,10 +227,10 @@ pass to :class:`.Lock` using the ``key`` argument::
def decorate(fn):
# ... gen_cached() from the previous example goes here
- # create an ad-hoc FileLock
- mutex = lockfile.FileLock(lock_path)
-
def invoke():
+ # create an ad-hoc FileLock
+ mutex = lockfile.FileLock(lock_path)
+
with Lock(mutex, gen_cached, get_value, expiration_time) as value:
return value
return invoke