-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
gh-133604: remove deprecated java_ver
function
#133888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
4f0b53e
373fe6a
b50dbed
cbc4dd4
51d2061
4157fa5
2c9d038
0139eb1
b9f2cf6
e0c4870
054efed
3a709ab
d50237c
b8c57ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -121,6 +121,12 @@ Deprecated | |||||
Removed | ||||||
======= | ||||||
|
||||||
platform | ||||||
--------- | ||||||
eendebakpt marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
* The deprecated :func:`!platform.java_ver` function. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
To save Benedikt copy-editing it later. (See line 133) You can also link this pr. (See line 134 as an example) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @StanFromIreland thank you! done |
||||||
|
||||||
|
||||||
sysconfig | ||||||
--------- | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
# | ||
# <see CVS and SVN checkin messages for history> | ||
# | ||
# 1.1.0 - removed deprecated java_ver() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not noteworthy enough IMO. These are rarely updated, but it is up to @malemburg in the end. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add to that list anymore. The checkin messages provide enough history. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @malemburg thank you! done |
||
# 1.0.9 - added invalidate_caches() function to invalidate cached values | ||
picnixz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# 1.0.8 - changed Windows support to read version from kernel32.dll | ||
# 1.0.7 - added DEV_NULL | ||
|
@@ -110,7 +111,7 @@ | |
|
||
""" | ||
|
||
__version__ = '1.0.9' | ||
__version__ = '1.1.0' | ||
|
||
import collections | ||
import os | ||
|
@@ -528,53 +529,6 @@ def ios_ver(system="", release="", model="", is_simulator=False): | |
return IOSVersionInfo(system, release, model, is_simulator) | ||
|
||
|
||
def _java_getprop(name, default): | ||
"""This private helper is deprecated in 3.13 and will be removed in 3.15""" | ||
from java.lang import System | ||
try: | ||
value = System.getProperty(name) | ||
if value is None: | ||
return default | ||
return value | ||
except AttributeError: | ||
return default | ||
|
||
def java_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 warnings | ||
warnings._deprecated('java_ver', remove=(3, 15)) | ||
# Import the needed APIs | ||
try: | ||
import java.lang # noqa: F401 | ||
except ImportError: | ||
return release, 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 | ||
|
||
return release, vendor, vminfo, osinfo | ||
|
||
|
||
AndroidVer = collections.namedtuple( | ||
"AndroidVer", "release api_level manufacturer model device is_emulator") | ||
|
||
|
@@ -1034,13 +988,6 @@ def uname(): | |
version = '16bit' | ||
system = 'Windows' | ||
|
||
elif system[:4] == 'java': | ||
release, vendor, vminfo, osinfo = java_ver() | ||
system = 'Java' | ||
version = ', '.join(vminfo) | ||
if not version: | ||
version = vendor | ||
|
||
# System specific extensions | ||
if system == 'OpenVMS': | ||
# OpenVMS seems to have release and version mixed up | ||
|
@@ -1370,15 +1317,6 @@ def platform(aliased=False, terse=False): | |
platform = _platform(system, release, machine, processor, | ||
'with', | ||
libcname+libcversion) | ||
elif system == 'Java': | ||
# Java platforms | ||
r, v, vminfo, (os_name, os_version, os_arch) = java_ver() | ||
if terse or not os_name: | ||
platform = _platform(system, release, version) | ||
else: | ||
platform = _platform(system, release, version, | ||
'on', | ||
os_name, os_version, os_arch) | ||
|
||
else: | ||
# Generic handler | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1 @@ | ||||||
Remove deprecated function :func:`!platform.java_ver`. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you! fixed it |
Uh oh!
There was an error while loading. Please reload this page.