File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ def save_element(curr_el):
156
156
val = getattr (curr_el , fmt .map (k ))
157
157
if val is None :
158
158
continue
159
+
159
160
if isinstance (fmt , ofmt .Property .__class__ ) and k == "value" :
160
161
# Custom odML tuples require special handling for save loading from file.
161
162
if curr_el .dtype and curr_el .dtype .endswith ("-tuple" ) and val :
@@ -274,10 +275,12 @@ def _handle_version(root):
274
275
"""
275
276
if root .tag != 'odML' :
276
277
raise ParserException ("Expecting <odML> tag but got <%s>.\n " % root .tag )
277
- elif 'version' not in root .attrib :
278
- raise ParserException ("Could not find format version attribute "
279
- "in <odML> tag.\n " )
280
- elif root .attrib ['version' ] != FORMAT_VERSION :
278
+
279
+ if 'version' not in root .attrib :
280
+ msg = "Could not find format version attribute in <odML> tag.\n "
281
+ raise ParserException (msg )
282
+
283
+ if root .attrib ['version' ] != FORMAT_VERSION :
281
284
msg = ("Cannot parse odML document with format version '%s'. \n "
282
285
"\t Use the 'VersionConverter' from 'odml.tools.converters' "
283
286
"to import previous odML formats."
You can’t perform that action at this time.
0 commit comments