gh-120417: Add #noqa to used imports in the stdlib (#120421)

Tools such as ruff can ignore "imported but unused" warnings if a
line ends with "# noqa: F401". It avoids the temptation to remove
an import which is used effectively.
This commit is contained in:
Victor Stinner 2024-06-13 16:14:50 +02:00 committed by GitHub
parent ca5108a46d
commit 6ae254aaa0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 40 additions and 36 deletions

View file

@ -546,7 +546,7 @@ def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')):
warnings._deprecated('java_ver', remove=(3, 15))
# Import the needed APIs
try:
import java.lang
import java.lang # noqa: F401
except ImportError:
return release, vendor, vminfo, osinfo