Skip to content

Commit

Permalink
Better reporting of deprecation warning (#611)
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Jan 29, 2024
2 parents 71ed9ee + 4a37fee commit 5435d0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SWIG/common.i
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ typedef int hash_t;
%pythoncode %{
def OldName(*args, **kwargs):
from warnings import warn
warn('%s is deprecated; use %s' % (OldName.__name__, NewName.__name__))
warn(f'{OldName.__name__} is deprecated; use {NewName.__name__}', FutureWarning, stacklevel=2)
return NewName(*args, **kwargs)
%}
#endif
Expand Down

0 comments on commit 5435d0e

Please sign in to comment.