PY-43972 FutureWarning in Python Console
authorElizaveta Shashkova <elizaveta.shashkova@jetbrains.com>
Wed, 12 Aug 2020 08:46:15 +0000 (11:46 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Wed, 12 Aug 2020 08:47:20 +0000 (08:47 +0000)
Suppress warnings when evaluating completion variants

GitOrigin-RevId: 7c6c5a4f5d1bfe5e637c2379bfa4aba8c96e5cf3

python/helpers/pydev/_pydev_bundle/_pydev_imports_tipper.py

index f4e2d9b8b3db14917387ee9dc65aa2d1ca8f0fdb..cb3bdeb4b95461b27b03c26b5628f5e3e1d1b73c 100644 (file)
@@ -4,6 +4,7 @@ import sys
 
 from _pydev_bundle._pydev_tipper_common import do_find
 from _pydevd_bundle.pydevd_constants import IS_PY2
+from _pydevd_bundle.pydevd_resolver import suppress_warnings
 
 if IS_PY2:
     from inspect import getargspec as _originalgetargspec
@@ -210,7 +211,8 @@ def generate_imports_tip_for_module(obj_to_complete, dir_comps=None, getattr=get
 
         try:
             # Fix for PY-38151: do not try to get `d` from the class, as it could be a descriptor
-            obj = getattr(obj_to_complete, d)
+            with suppress_warnings():
+                obj = getattr(obj_to_complete, d)
         except: #just ignore and get it without additional info
             ret.append((d, '', args, TYPE_BUILTIN))
         else: