Skip to content

Commit

Permalink
Enable use as a context decorator (documentation) (tox-dev#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch-alter-lynxight committed Jan 3, 2022
1 parent fcb4e21 commit 869d129
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ locks:
finally:
lock.release()
@lock
def decorated():
open(file_path, "a").write("You're a decorated Jedi!")
decorated()
The :meth:`acquire <filelock.BaseFileLock.acquire>` method accepts also a ``timeout`` parameter. If the lock cannot be
acquired within ``timeout`` seconds, a :class:`Timeout <filelock.Timeout>` exception is raised:

Expand Down

0 comments on commit 869d129

Please sign in to comment.