Skip to content

Commit

Permalink
Merge pull request #666 from SMI/bugfix/python
Browse files Browse the repository at this point in the history
Silence deprecation warning from newer Python
  • Loading branch information
howff authored Mar 12, 2021
2 parents 934c82e + 56dc2eb commit 4f93074
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/666-bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Silence deprecation warning from newer Python as noted by the azure pipeline test
4 changes: 2 additions & 2 deletions src/common/Smi_Common_Python/SmiServices/Dicom.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 == '':
Expand Down

0 comments on commit 4f93074

Please sign in to comment.