Trying to build older version of opencv with contrib for ios: Not possible?

I’m a total stranger to python but I tried the fallowing. Unfortunately it didn’t work:

def getXCodeMajor():
ret = check_output([“xcodebuild”, “-version”]).decode(‘utf-8’)
print (‘---------’ , ret)
m = re.match(r’Xcode\s+(\d+)..*', ret, flags=re.IGNORECASE)
ret = ret.decode(‘utf-8’)

if m:
    return int(m.group(1))
else:
    raise Exception("Failed to parse Xcode version")