Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP #1750 > support/v5.12] [python] Fix iterating over measurement which was broken by fe84826 #1752

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lang/python/ecalhdf5/ecal/measurement/measurement.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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__()
Expand All @@ -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))
Expand Down
Loading