mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Merge branch 'dev' into 'master'
Fix winreg import pass on non-NT systems See merge request crafty-controller/crafty-4!344
This commit is contained in:
commit
025db1de77
@ -1,7 +1,6 @@
|
||||
import contextlib
|
||||
import os
|
||||
import re
|
||||
import winreg
|
||||
import sys
|
||||
import json
|
||||
import tempfile
|
||||
@ -30,6 +29,12 @@ from app.classes.web.websocket_helper import WebSocketHelper
|
||||
with redirect_stderr(NullWriter()):
|
||||
import psutil
|
||||
|
||||
# winreg is only a package on windows-python. We will only import
|
||||
# this on windows systems to avoid a module not found error
|
||||
# this is only needed for windows java path shenanigans
|
||||
if os.name == "nt":
|
||||
import winreg
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
try:
|
||||
@ -134,7 +139,7 @@ class Helpers:
|
||||
)
|
||||
)
|
||||
return kjdk_current_values["JavaHome"]
|
||||
except WindowsError as e: # pylint: disable=E0602
|
||||
except OSError as e:
|
||||
if e.errno == 2:
|
||||
continue
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user