Skip to content

Commit 02b05f1

Browse files
committed
Correct replace function
The function to replace wasn't correctly determined which lead to None.
1 parent d059578 commit 02b05f1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

semver.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,18 @@ def wrapper(*args, **kwargs):
5555
else:
5656
msg.append("Use the respective 'semver.VersionInfo.{r}' instead.")
5757

58-
# warnings.simplefilter('always', category)
58+
r = replace or func.__name__
5959
frame = inspect.currentframe().f_back
6060

6161
msg = " ".join(msg)
62-
msg = msg.format(f=func.__name__, r=replace, v=version)
62+
msg = msg.format(f=func.__name__, r=r, v=version)
6363
warnings.warn_explicit(
6464
msg,
6565
category=category,
6666
# stacklevel=2,
6767
filename=inspect.getfile(frame.f_code),
6868
lineno=frame.f_lineno,
6969
)
70-
# warnings.simplefilter('default', category)
7170
# As recommended in the Python documentation
7271
# https://docs.python.org/3/library/inspect.html#the-interpreter-stack
7372
# better remove the interpreter stack:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy