Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Consider deprecatingplatform.java_ver because it is only helpful for Jython #116349

Closed
Assignees
sobolevn
Labels
stdlibPython modules in the Lib dirtype-featureA feature request or enhancement
@sobolevn

Description

@sobolevn

Feature or enhancement

What do you think about deprecatingplatform.java_ver? It is never used on CPython, it is a helper forJython only, which is basically stuck on 2.7 for the last 10 years.

I think that we should deprecate and remove such compat parts with tools that no longer exist. In the future Jython can add its own implementation to its own stdlib, if ever.

cpython/Lib/platform.py

Lines 516 to 547 ina29998a

defjava_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')):
""" Version interface for Jython.
Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
tuple (os_name, os_version, os_arch).
Values which cannot be determined are set to the defaults
given as parameters (which all default to '').
"""
# Import the needed APIs
try:
importjava.lang
exceptImportError:
returnrelease,vendor,vminfo,osinfo
vendor=_java_getprop('java.vendor',vendor)
release=_java_getprop('java.version',release)
vm_name,vm_release,vm_vendor=vminfo
vm_name=_java_getprop('java.vm.name',vm_name)
vm_vendor=_java_getprop('java.vm.vendor',vm_vendor)
vm_release=_java_getprop('java.vm.version',vm_release)
vminfo=vm_name,vm_release,vm_vendor
os_name,os_version,os_arch=osinfo
os_arch=_java_getprop('java.os.arch',os_arch)
os_name=_java_getprop('java.os.name',os_name)
os_version=_java_getprop('java.os.version',os_version)
osinfo=os_name,os_version,os_arch
returnrelease,vendor,vminfo,osinfo

I propose to depreacate / remove it in 3.13 / 3.15

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp