mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 05:29:54 +08:00
java: wrap StringIO() to support unicode strings
This commit is contained in:
parent
00367289bd
commit
60fb1fde75
@ -11,7 +11,12 @@ from string import Template
|
||||
if sys.version_info[0] >= 3:
|
||||
from io import StringIO
|
||||
else:
|
||||
from cStringIO import StringIO
|
||||
import io
|
||||
class StringIO(io.StringIO):
|
||||
def write(self, s):
|
||||
if isinstance(s, str):
|
||||
s = unicode(s) # noqa: F821
|
||||
return super(StringIO, self).write(s)
|
||||
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user