projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f2aeef
)
Mod: Open header files with `io.open` for Python 2/3 compatibility.
author
Shiquan Wang
<shiquanwang@gmail.com>
Mon, 10 Nov 2014 05:39:18 +0000
(13:39 +0800)
committer
Shiquan Wang
<shiquanwang@gmail.com>
Mon, 10 Nov 2014 13:09:43 +0000
(21:09 +0800)
modules/python/src2/hdr_parser.py
patch
|
blob
|
history
diff --git
a/modules/python/src2/hdr_parser.py
b/modules/python/src2/hdr_parser.py
index
3e202fd
..
ea32a17
100755
(executable)
--- a/
modules/python/src2/hdr_parser.py
+++ b/
modules/python/src2/hdr_parser.py
@@
-1,7
+1,7
@@
#!/usr/bin/env python
from __future__ import print_function
-import os, sys, re, string
+import os, sys, re, string
, io
# the list only for debugging. The real list, used in the real OpenCV build, is specified in CMakeLists.txt
opencv_hdr_list = [
@@
-734,7
+734,7
@@
class CppHeaderParser(object):
"""
self.hname = hname
decls = []
- f =
open(hname, "rt"
)
+ f =
io.open(hname, 'rt', encoding='utf-8'
)
linelist = list(f.readlines())
f.close()