From: Mike Izbicki Date: Fri, 2 Jan 2015 22:41:44 +0000 (-0800) Subject: fix to work with python 2.6 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~2739^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac47c0c624fade8a83e4df7df0da7e55966c10f3;p=platform%2Fupstream%2Fopencv.git fix to work with python 2.6 I had to make this modification locally to get opencv to build with python 2.6. Python 2.6 requires indices in the format string (the `0` I added). This requirement was relaxed in 2.7, so what used to be there would be working for people who could upgrade. I don't think the change has any negative consequences for future python versions, but I'm no expert. --- diff --git a/modules/python/src2/gen2.py b/modules/python/src2/gen2.py index cf60ea9..55a7948 100755 --- a/modules/python/src2/gen2.py +++ b/modules/python/src2/gen2.py @@ -861,7 +861,7 @@ class PythonWrapperGenerator(object): decls = self.parser.parse(hdr) if len(decls) == 0: continue - self.code_include.write( '#include "{}"\n'.format(hdr[hdr.rindex('opencv2/'):]) ) + self.code_include.write( '#include "{0}"\n'.format(hdr[hdr.rindex('opencv2/'):]) ) for decl in decls: name = decl[0] if name.startswith("struct") or name.startswith("class"):