gh-116349: Deprecate platform.java_ver function (#116471)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Nikita Sobolev 2024-03-08 11:14:17 +03:00 committed by GitHub
parent 4d952737e6
commit 0b647141d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 26 additions and 4 deletions

View file

@ -318,9 +318,13 @@ class PlatformTest(unittest.TestCase):
platform._uname_cache = None
def test_java_ver(self):
res = platform.java_ver()
if sys.platform == 'java': # Is never actually checked in CI
self.assertTrue(all(res))
import re
msg = re.escape(
"'java_ver' is deprecated and slated for removal in Python 3.15"
)
with self.assertWarnsRegex(DeprecationWarning, msg):
res = platform.java_ver()
self.assertEqual(len(res), 4)
def test_win32_ver(self):
res = platform.win32_ver()