Skip to content

Commit

Permalink
Suppress DeprecationWarning from pydevd due to pkg_resources.declare_…
Browse files Browse the repository at this point in the history
…namespace (#1230)
  • Loading branch information
Pavel Minaev authored and int19h committed Apr 4, 2023
1 parent bc44eb8 commit 00bc513
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/debugpy/_vendored/force_pydevd.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,28 @@

# Constants must be set before importing any other pydevd module
# # due to heavy use of "from" in them.
with vendored('pydevd'):
pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
with vendored('pydevd'):
pydevd_constants = import_module('_pydevd_bundle.pydevd_constants')
# We limit representation size in our representation provider when needed.
pydevd_constants.MAXIMUM_VARIABLE_REPRESENTATION_SIZE = 2 ** 32

# Now make sure all the top-level modules and packages in pydevd are
# loaded. Any pydevd modules that aren't loaded at this point, will
# be loaded using their parent package's __path__ (i.e. one of the
# following).
preimport('pydevd', [
'_pydev_bundle',
'_pydev_runfiles',
'_pydevd_bundle',
'_pydevd_frame_eval',
'pydev_ipython',
'pydevd_plugins',
'pydevd',
])
with warnings.catch_warnings():
warnings.simplefilter("ignore", category=DeprecationWarning)
preimport('pydevd', [
'_pydev_bundle',
'_pydev_runfiles',
'_pydevd_bundle',
'_pydevd_frame_eval',
'pydev_ipython',
'pydevd_plugins',
'pydevd',
])

# When pydevd is imported it sets the breakpoint behavior, but it needs to be
# overridden because by default pydevd will connect to the remote debugger using
Expand Down

0 comments on commit 00bc513

Please sign in to comment.