mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-15 23:05:57 +08:00
Make popen kwargs OS specific
Contribute to CURA-10619
This commit is contained in:
parent
023f2f6e0f
commit
fa52469f5d
@ -8,6 +8,7 @@ from UM.Message import Message
|
|||||||
from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender
|
from UM.Settings.AdditionalSettingDefinitionAppender import AdditionalSettingDefinitionsAppender
|
||||||
from UM.PluginObject import PluginObject
|
from UM.PluginObject import PluginObject
|
||||||
from UM.i18n import i18nCatalog
|
from UM.i18n import i18nCatalog
|
||||||
|
from UM.Platform import Platform
|
||||||
|
|
||||||
|
|
||||||
class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject):
|
class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject):
|
||||||
@ -58,7 +59,10 @@ class BackendPlugin(AdditionalSettingDefinitionsAppender, PluginObject):
|
|||||||
# STDIN needs to be None because we provide no input, but communicate via a local socket instead.
|
# STDIN needs to be None because we provide no input, but communicate via a local socket instead.
|
||||||
# The NUL device sometimes doesn't exist on some computers.
|
# The NUL device sometimes doesn't exist on some computers.
|
||||||
Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}")
|
Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}")
|
||||||
self._process = subprocess.Popen(self._validatePluginCommand(), stdin = None, creationflags = subprocess.CREATE_NO_WINDOW)
|
popen_kwargs = {"stdin": None}
|
||||||
|
if Platform.isWindows():
|
||||||
|
popen_kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW
|
||||||
|
self._process = subprocess.Popen(self._validatePluginCommand(), **popen_kwargs)
|
||||||
self._is_running = True
|
self._is_running = True
|
||||||
return True
|
return True
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user