You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defformatdoc(obj):
"""Substitute globals and locals into an object's docstring."""frame=inspect.currentframe().f_backtry:
obj.__doc__=obj.__doc__.format(
**{**frame.f_globals, **frame.f_locals}
)
returnobjfinally:
delframe
The TRY300 is reported on return obj. But the else clause is available only when the except clause is present (there needs to be at least one). So TRY300 should not be reported if there is no except clause. Or it should have different text describing that.
Currently:
TRY300 Consider moving this statement to an `else` block
Possible:
TRY300 Consider moving this statement after `try: finally:`
The text was updated successfully, but these errors were encountered:
In napari we have such a function https://github.com/napari/napari/blob/ab885957fb5a2220a3078851ad7dc97a7a82cc05/napari/utils/misc.py#L253
The
TRY300
is reported onreturn obj
. But the else clause is available only when theexcept
clause is present (there needs to be at least one). SoTRY300
should not be reported if there is no except clause. Or it should have different text describing that.Currently:
Possible:
The text was updated successfully, but these errors were encountered: