Skip to content

bpo-41282: Fix distutils.utils.byte_compile() DeprecationWarning - #25406

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:fix_distutils_deprecatation_warns
Apr 16, 2021
Merged

vstinner merged 1 commit into
python:masterfrom
vstinner:fix_distutils_deprecatation_warns

Conversation

@vstinner

@vstinner vstinner commented Apr 14, 2021 •

Copy link
Copy Markdown
Member
  • byte_compile() of distutils.utils no longer logs a
    DeprecationWarning
  • test_distutils no longer logs a DeprecationWarning

https://bugs.python.org/issue41282

* byte_compile() of distutils.utils no longer logs a
  DeprecationWarning
* test_distutils no longer logs a DeprecationWarning
Comment thread Lib/distutils/util.py
msg = distutils._DEPRECATION_MESSAGE
cmd = [sys.executable]
cmd.extend(subprocess._optim_args_from_interpreter_flags())
cmd.append(f'-Wignore:{msg}:DeprecationWarning')

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sadly, -W option escapes the message using re.escape(), it's not possible to use a regex :-(

@vstinner

Copy link
Copy Markdown
Member Author
@vstinner
vstinner merged commit 69ca32e into python:master Apr 16, 2021
@vstinner
vstinner deleted the fix_distutils_deprecatation_warns branch April 16, 2021 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants