Skip to content

Commit ac9549f

Browse files
benedikt-voelkelBenedikt Volkel
andauthored
Make reading patterns from file more resilient (AliceO2Group#1450)
Co-authored-by: Benedikt Volkel <benedikt.volkel@cern.ch>
1 parent 7e20a7f commit ac9549f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

RelVal/utils/o2dpg_release_validation_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,15 @@ def set_object_name_patterns(self, include_patterns, exclude_patterns):
280280
def load_this_patterns(patterns):
281281
if not patterns or not patterns[0].startswith("@"):
282282
return patterns
283+
284+
patterns_from_file = []
283285
with open(patterns[0][1:], "r") as f:
284-
return f.read().splitlines()
286+
for line in f:
287+
line = line.strip()
288+
if not line:
289+
continue
290+
patterns_from_file.append(line)
291+
return patterns_from_file
285292

286293
self.include_patterns = load_this_patterns(include_patterns)
287294
self.exclude_patterns = load_this_patterns(exclude_patterns)

0 commit comments

Comments
 (0)