From a3dad0fa09749767147f8369030235d964a9f766 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 26 Jul 2019 10:55:55 +0200 Subject: [PATCH] Fix issue with deprecation and pyqtSlot --- cura/Settings/MachineManager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index 752e3bceb9..4b2d9f8f51 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -986,10 +986,13 @@ class MachineManager(QObject): self._application.globalContainerStackChanged.emit() self.forceUpdateAllSettings() - # Note that this function is deprecated, but the decorators for this don't play well together! - # @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2") @pyqtSlot(int, result = QObject) def getExtruder(self, position: int) -> Optional[ExtruderStack]: + return self._getExtruder(position) + + # This is a workaround for the deprecated decorator and the pyqtSlot not playing well together. + @deprecated("use Cura.MachineManager.activeMachine.extruders instead", "4.2") + def _getExtruder(self, position) -> Optional[ExtruderStack]: if self._global_container_stack: return self._global_container_stack.extruders.get(str(position)) return None