diff --git a/news/666-bugfix.md b/news/666-bugfix.md new file mode 100644 index 000000000..3fb94885c --- /dev/null +++ b/news/666-bugfix.md @@ -0,0 +1 @@ +Silence deprecation warning from newer Python as noted by the azure pipeline test diff --git a/src/common/Smi_Common_Python/SmiServices/Dicom.py b/src/common/Smi_Common_Python/SmiServices/Dicom.py index 8880b752f..fbcdfc17b 100644 --- a/src/common/Smi_Common_Python/SmiServices/Dicom.py +++ b/src/common/Smi_Common_Python/SmiServices/Dicom.py @@ -1,7 +1,7 @@ """ Functions to assist with decoding DICOM files representing from JSON as Python dicts """ -import collections +from collections import Mapping import re import pydicom @@ -50,7 +50,7 @@ def tag_val(dicomdict, tagname): retval = dicomdict[alt_tagname] # The dcm2jsom or pydicom style has 'vr' and 'Value' keys # so extract the Value (also sometimes has vr but no Value). - if isinstance(retval, collections.Mapping): + if isinstance(retval, Mapping): if 'vr' in retval: val = retval.get('Value', '') # pydicom and dcm2json write Value if val == '':