File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 126
126
import logging
127
127
lgr = logging .getLogger ('heudiconv' )
128
128
129
+ # pythons before 3.7 didn't have re.Pattern, it was some protected
130
+ # _sre.SRE_Pattern, so let's just sample a class of the compiled regex
131
+ re_Pattern = re .compile ('.' ).__class__
132
+
129
133
# Terminology to harmonise and use to name variables etc
130
134
# experiment
131
135
# subject
@@ -416,7 +420,7 @@ def fix_dbic_protocol(seqinfo):
416
420
# Then go through all regexps returning regex "search" result
417
421
# on study_description
418
422
for sub , substitutions in protocols2fix .items ():
419
- if isinstance (sub , re . Pattern ) and sub .search (study_description ):
423
+ if isinstance (sub , re_Pattern ) and sub .search (study_description ):
420
424
_apply_substitutions (seqinfo ,
421
425
substitutions ,
422
426
'%r regex matching' % sub .pattern )
You can’t perform that action at this time.
0 commit comments