Skip to content

Commit

Permalink
update for tox errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AvdN committed Jul 27, 2023
1 parent 2fd722c commit 60e6216
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lona/view_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def start(self):
lona.warnings.warn( # NOQA: G010
'Deprecated use of dict as return value of method handle_request\n (see: https://lona-web.org/1.x/api-reference/views.html#response-objects)',
lona.warnings.DictResponseDeprecationWarning,
callee=self.view.handle_request
callee=self.view.handle_request,
)

response = parse_view_return_value(
Expand Down
8 changes: 4 additions & 4 deletions lona/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ExtendedWarn:
warn = org_warnings.warn

def __call__(
self, message, category=None, stacklevel=1, source=None, callee=None
self, message, category=None, stacklevel=1, source=None, callee=None,
):
# Check if message is already a Warning object
if isinstance(message, Warning):
Expand All @@ -18,10 +18,10 @@ def __call__(
message = ('callee', message, filename, lineno, category)
else:
stacklevel += 1
self.warn(message, category, stacklevel, source) # NOQA
self.warn(message, category, stacklevel, source) # NOQA: G010


org_warnings.warn = warn = ExtendedWarn()
org_warnings.warn = warn = ExtendedWarn() # type: ignore

_org_formatwarning = org_warnings.formatwarning

Expand All @@ -40,7 +40,7 @@ def my_formatwarning(message, category, filename, lineno, line):
return _org_formatwarning(message, category, filename, lineno, line)


org_warnings.formatwarning = my_formatwarning
org_warnings.formatwarning = my_formatwarning # type: ignore


class DictResponseDeprecationWarning(PendingDeprecationWarning):
Expand Down

0 comments on commit 60e6216

Please sign in to comment.