# HG changeset patch # User Alain Mazy # Date 1706776917 -3600 # Node ID 575aa420f86653a24284f48c319dcf8237769d21 # Parent 09fc76fbd46dcf3c14ef50b3bc10637a6e2f31f6 fix worklist tests for python2 diff -r 09fc76fbd46d -r 575aa420f866 Plugins/Worklists/Run.py --- a/Plugins/Worklists/Run.py Wed Jan 31 13:51:40 2024 +0100 +++ b/Plugins/Worklists/Run.py Thu Feb 01 09:41:57 2024 +0100 @@ -114,10 +114,16 @@ args.server, str(args.dicom), f.name ], stderr = subprocess.STDOUT).splitlines() - a = list(map(lambda x: x.decode('utf-8', errors="ignore"), a)) + if sys.version_info.major == 2: + if len(list(filter(lambda x: x.startswith('E:'), a))) > 0: + raise Exception('Error while running findscu') + else: + # pprint.pprint(a) + a = list(map(lambda x: x.decode('utf-8', errors="ignore"), a)) + # pprint.pprint(a) - if len(list(filter(lambda x: x.startswith('E:'), a))) > 0: - raise Exception('Error while running findscu') + if len(list(filter(lambda x: x.startswith('E:'), a))) > 0: + raise Exception('Error while running findscu') b = map(lambda x: x[3:], filter(lambda x: (x.startswith('I: ---') or x.startswith('W: ---') or