diff --git a/sloth/core/labeltool.py b/sloth/core/labeltool.py index df758c8..9c231b7 100755 --- a/sloth/core/labeltool.py +++ b/sloth/core/labeltool.py @@ -287,7 +287,7 @@ class LabelTool(QObject): current = self._current_image if current is None: - current = self._model.iterator(ImageModelItem).next() + current = next(self._model.iterator(ImageModelItem)) next_image = current.getSibling(idx) if next_image is not None: @@ -298,7 +298,7 @@ class LabelTool(QObject): if self._current_image is not None: next_image = self._current_image.getNextSibling(step) else: - next_image = self._model.iterator(ImageModelItem).next() + next_image = next(self._model.iterator(ImageModelItem)) if next_image is not None: next_image = next_image.getNextSibling(step-1) diff --git a/sloth/gui/labeltool.py b/sloth/gui/labeltool.py index b1a0793..90caa31 100755 --- a/sloth/gui/labeltool.py +++ b/sloth/gui/labeltool.py @@ -48,10 +48,7 @@ class BackgroundLoader(QObject): self._message_displayed = True if self._level <= self._max_levels and self._rows > 0: try: - if hasattr(self._iterator, "next"): - item = self._iterator.next() - else: - item = next(self._iterator) + item = next(self._iterator) self._next_rows += item.rowCount() self._pos += 1 self._progress.setValue(int((float(self._pos) / float(self._rows) + self._level - 1) * 1000)) diff --git a/sloth/gui/propertyeditor.py b/sloth/gui/propertyeditor.py index 56e0f83..482c781 100644 --- a/sloth/gui/propertyeditor.py +++ b/sloth/gui/propertyeditor.py @@ -179,11 +179,7 @@ class DefaultAttributeHandler(QGroupBox, AbstractAttributeHandler): self._inputField.setPlaceholderText(", ".join(selected_values)) elif len(selected_values) == 1: it = iter(selected_values) - if hasattr(it, 'next'): - self._inputField.setText(it.next()) - else: - self._inputField.setText(next(it)) - + self._inputField.setText(next(it)) def updateButtons(self): selected_values = self.getSelectedValues()