Fix script fix_swig_imports.py to work with swig version 3.09

This commit is contained in:
jean-pierre charras 2016-06-13 19:50:29 +02:00
parent 9b2dba2b1b
commit 1e7b0f83d9
1 changed files with 7 additions and 1 deletions

View File

@ -37,7 +37,13 @@ if (len(lines)<4000):
txt = "" txt = ""
for l in lines: for l in lines:
if l.startswith("if version_info >= (2,6,0):"): # ok with swig version <= 3.0.2 if l.startswith("if version_info >= (2, 7, 0):"): # ok with swig version >= 3.0.9
l = l.replace("version_info >= (2, 7, 0)","False")
doneOk = True
elif l.startswith("elif version_info >= (2, 6, 0):"): # needed with swig version >= 3.0.9
l = l.replace("version_info >= (2, 6, 0)","False")
doneOk = True
elif l.startswith("if version_info >= (2,6,0):"): # ok with swig version <= 3.0.2
l = l.replace("version_info >= (2,6,0)","False") l = l.replace("version_info >= (2,6,0)","False")
doneOk = True doneOk = True
elif l.startswith("if version_info >= (2, 6, 0):"): # needed with swig version 3.0.3 elif l.startswith("if version_info >= (2, 6, 0):"): # needed with swig version 3.0.3