Skip to content

Commit 9e1de24

Browse files
committed
ref: if formulation
1 parent e4f3176 commit 9e1de24

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

nibabel/xmlutils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ def to_xml(self, enc='utf-8'):
2828
""" Output should be an xml string with the given encoding.
2929
(default: utf-8)"""
3030
ele = self._to_xml_element()
31-
if ele is None:
32-
return ''
33-
else:
34-
return tostring(ele, enc)
31+
return '' if ele is None else tostring(ele, enc)
3532

3633

3734
class XmlBasedHeader(FileBasedHeader, XmlSerializable):

0 commit comments

Comments
 (0)