From 287d9088ad68063a7565275883bab5bd3522a63b Mon Sep 17 00:00:00 2001 From: eclipse-ecal-bot <111572016+eclipse-ecal-bot@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:42:58 +0200 Subject: [PATCH] [python] Fix iterating over measurement which was broken by fe84826 (#1748) (#1750) (#1751) Co-authored-by: KerstinKeller --- lang/python/ecalhdf5/ecal/measurement/measurement.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lang/python/ecalhdf5/ecal/measurement/measurement.py b/lang/python/ecalhdf5/ecal/measurement/measurement.py index fd230bdd25..720b5dda8c 100644 --- a/lang/python/ecalhdf5/ecal/measurement/measurement.py +++ b/lang/python/ecalhdf5/ecal/measurement/measurement.py @@ -1,6 +1,6 @@ # ========================= eCAL LICENSE ================================= # -# Copyright (C) 2016 - 2019 Continental Corporation +# Copyright (C) 2016 - 2024 Continental Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -191,8 +191,9 @@ def __init__(self, measurement, channel_type): self._measurement = measurement self._iterator = iter(measurement.channel_names) self._channel_type = channel_type + def __next__(self): - return self._channel_type(self._measurement, self._iterator.next()) + return self._channel_type(self._measurement, self._iterator.__next__()) def next(self): return self.__next__() @@ -212,7 +213,7 @@ def __getitem__(self, channel_name): return self._channel_type(self, channel_name) def __iter__(self): - return Measurement.Iterator(self) + return Measurement.Iterator(self, self._channel_type) def __repr__(self): return "< Measurement object: path: %s - number of channels: %i >" % (self._path, len(self.channel_names))