Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stacklevel to deprecation warnings for argument name change #121

Merged
merged 2 commits into from
Dec 26, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/filelock/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def acquire(
self,
timeout: Optional[float] = None,
poll_interval: float = 0.05,
*,
gaborbernat marked this conversation as resolved.
Show resolved Hide resolved
poll_intervall: Optional[float] = None,
) -> AcquireReturnProxy:
"""
Expand Down Expand Up @@ -138,8 +139,8 @@ def acquire(

.. versionchanged:: 2.0.0

This method returns now a *proxy* object instead of *self*, so that it can be used in a with statement \
without side effects.
This method returns now a *proxy* object instead of *self*,
so that it can be used in a with statement without side effects.

"""
# Use the default timeout, if no timeout is provided.
Expand All @@ -148,7 +149,7 @@ def acquire(

if poll_intervall is not None:
msg = "use poll_interval instead of poll_intervall"
warnings.warn(msg, DeprecationWarning)
warnings.warn(msg, DeprecationWarning, stacklevel=2)
poll_interval = poll_intervall

# Increment the number right at the beginning. We can still undo it, if something fails.
Expand Down
1 change: 1 addition & 0 deletions whitelist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ unlck
util
win32
wronly
stacklevel