Skip to content

Commit

Permalink
Merge pull request #376 from imlison/fix/375
Browse files Browse the repository at this point in the history
fixed `deprecated` decorator
  • Loading branch information
josephmancuso authored Dec 28, 2020
2 parents d600225 + a04acc4 commit 2380294
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/masonite/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,15 @@ def __new__(cls, *args):


def deprecated(message):
warnings.simplefilter("default", DeprecationWarning)

def deprecated_decorator(func):
def deprecated_func(*args, **kwargs):
warnings.warn(
"{} is a deprecated function. {}".format(func.__name__, message),
category=DeprecationWarning,
stacklevel=2,
)
warnings.simplefilter("default", DeprecationWarning)
return func(*args, **kwargs)

return deprecated_func
Expand Down

0 comments on commit 2380294

Please sign in to comment.