File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
astroid/interpreter/_import Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ def find_module(
148
148
)
149
149
else :
150
150
try :
151
- with warnings .catch_warnings (action = "ignore" ):
151
+ with warnings .catch_warnings ():
152
+ warnings .filterwarnings ("ignore" , category = UserWarning )
152
153
spec = importlib .util .find_spec (modname )
153
154
if (
154
155
spec
Original file line number Diff line number Diff line change @@ -387,7 +387,8 @@ def test_raises_exception_for_empty_modname(self) -> None:
387
387
class IsolatedAstroidManagerTest (resources .AstroidCacheSetupMixin , unittest .TestCase ):
388
388
def test_no_user_warning (self ):
389
389
mgr = manager .AstroidManager ()
390
- with warnings .catch_warnings (action = "error" ):
390
+ with warnings .catch_warnings ():
391
+ warnings .filterwarnings ("error" , category = UserWarning )
391
392
mgr .ast_from_module_name ("setuptools" )
392
393
mgr .ast_from_module_name ("pip" )
393
394
You can’t perform that action at this time.
0 commit comments