11import datetime
2- import distutils .version
2+ from packaging .version import Version
33import os
44import re
55from collections import OrderedDict
@@ -189,7 +189,7 @@ def __init__(self, filename):
189189 self ['ApplicationName' ] = 'Neuraview'
190190 app_version = '2'
191191
192- self ['ApplicationVersion' ] = distutils . version . LooseVersion (app_version )
192+ self ['ApplicationVersion' ] = Version (app_version )
193193
194194 # convert bit_to_microvolt
195195 if 'bit_to_microVolt' in self :
@@ -215,22 +215,22 @@ def __init__(self, filename):
215215 an = self ['ApplicationName' ]
216216 if an == 'Cheetah' :
217217 av = self ['ApplicationVersion' ]
218- if av <= '2' : # version 1 uses same as older versions
218+ if av <= Version ( '2' ) : # version 1 uses same as older versions
219219 hpd = NlxHeader .header_pattern_dicts ['bv5.6.4' ]
220- elif av < '5' :
220+ elif av < Version ( '5' ) :
221221 hpd = NlxHeader .header_pattern_dicts ['bv5' ]
222- elif av <= '5.4.0' :
222+ elif av <= Version ( '5.4.0' ) :
223223 hpd = NlxHeader .header_pattern_dicts ['v5.4.0' ]
224- elif av <= '5.6.4' :
224+ elif av <= Version ( '5.6.4' ) :
225225 hpd = NlxHeader .header_pattern_dicts ['bv5.6.4' ]
226226 else :
227227 hpd = NlxHeader .header_pattern_dicts ['def' ]
228228 elif an == 'BML' :
229229 hpd = NlxHeader .header_pattern_dicts ['bml' ]
230- av = "2"
230+ av = Version ( "2" )
231231 elif an == 'Neuraview' :
232232 hpd = NlxHeader .header_pattern_dicts ['neuraview2' ]
233- av = "2"
233+ av = Version ( "2" )
234234 else :
235235 an = "Unknown"
236236 av = "NA"
0 commit comments