Exempt R1717 consideration

This commit is contained in:
Zedifus 2022-06-15 04:52:19 +01:00
parent 0f82ba3084
commit 00466719ea

View File

@ -113,21 +113,25 @@ class Helpers:
for jdk_key_path in jdk_key_paths: for jdk_key_path in jdk_key_paths:
try: try:
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, jdk_key_path) as kjdk: with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, jdk_key_path) as kjdk:
kjdk_values = dict( kjdk_values = (
[ dict( # pylint: disable=consider-using-dict-comprehension
winreg.EnumValue(kjdk, i)[:2] [
for i in range(winreg.QueryInfoKey(kjdk)[1]) winreg.EnumValue(kjdk, i)[:2]
] for i in range(winreg.QueryInfoKey(kjdk)[1])
]
)
) )
current_version = kjdk_values["CurrentVersion"] current_version = kjdk_values["CurrentVersion"]
kjdk_current = winreg.OpenKey( kjdk_current = winreg.OpenKey(
winreg.HKEY_LOCAL_MACHINE, jdk_key_path + "\\" + current_version winreg.HKEY_LOCAL_MACHINE, jdk_key_path + "\\" + current_version
) )
kjdk_current_values = dict( kjdk_current_values = (
[ dict( # pylint: disable=consider-using-dict-comprehension
winreg.EnumValue(kjdk_current, i)[:2] [
for i in range(winreg.QueryInfoKey(kjdk_current)[1]) winreg.EnumValue(kjdk_current, i)[:2]
] for i in range(winreg.QueryInfoKey(kjdk_current)[1])
]
)
) )
return kjdk_current_values["JavaHome"] return kjdk_current_values["JavaHome"]
except WindowsError as e: # pylint: disable=E0602 except WindowsError as e: # pylint: disable=E0602