mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 12:08:18 +00:00
Python 3.x string decoding fix
This commit is contained in:
parent
6b5e49c4a1
commit
706a037bf4
|
@ -99,7 +99,7 @@ else:
|
||||||
if s != None:
|
if s != None:
|
||||||
enc = sys.stdout.encoding
|
enc = sys.stdout.encoding
|
||||||
if enc != None: return s.decode(enc)
|
if enc != None: return s.decode(enc)
|
||||||
else: return s
|
else: return s.decode('ascii')
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
|
@ -1157,7 +1157,13 @@ def set_pp_option(k, v):
|
||||||
def obj_to_string(a):
|
def obj_to_string(a):
|
||||||
out = io.StringIO()
|
out = io.StringIO()
|
||||||
_PP(out, _Formatter(a))
|
_PP(out, _Formatter(a))
|
||||||
return out.getvalue()
|
r = out.getvalue()
|
||||||
|
if sys.version < '3':
|
||||||
|
return r
|
||||||
|
else:
|
||||||
|
enc = sys.stdout.encoding
|
||||||
|
if enc != None: return r.decode(enc)
|
||||||
|
return r
|
||||||
|
|
||||||
_html_out = None
|
_html_out = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue