mirror of
https://github.com/Z3Prover/z3
synced 2025-06-09 15:43:25 +00:00
parent
4e8ba8b160
commit
0eb04df834
1 changed files with 25 additions and 17 deletions
|
@ -1819,25 +1819,33 @@ if _lib is None:
|
||||||
print(" builtins.Z3_LIB_DIRS = [ '/path/to/libz3.%s' ] " % _ext)
|
print(" builtins.Z3_LIB_DIRS = [ '/path/to/libz3.%s' ] " % _ext)
|
||||||
raise Z3Exception("libz3.%s not found." % _ext)
|
raise Z3Exception("libz3.%s not found." % _ext)
|
||||||
|
|
||||||
def _str_to_bytes(s):
|
# def _str_to_bytes(s):
|
||||||
if isinstance(s, str):
|
# if isinstance(s, str):
|
||||||
try:
|
# try:
|
||||||
return s.encode('latin-1')
|
# return s.encode('latin-1')
|
||||||
except:
|
# except:
|
||||||
# kick the bucket down the road. :-J
|
# # kick the bucket down the road. :-J
|
||||||
return s
|
# return s
|
||||||
else:
|
# else:
|
||||||
return s
|
# return s
|
||||||
|
|
||||||
if sys.version < '3':
|
if sys.version < '3':
|
||||||
|
def _str_to_bytes(s):
|
||||||
|
return s
|
||||||
def _to_pystr(s):
|
def _to_pystr(s):
|
||||||
return s
|
return s
|
||||||
else:
|
else:
|
||||||
|
def _str_to_bytes(s):
|
||||||
|
if isinstance(s, str):
|
||||||
|
enc = sys.stdout.encoding
|
||||||
|
return s.encode(enc if enc != None else 'latin-1')
|
||||||
|
else:
|
||||||
|
return s
|
||||||
|
|
||||||
def _to_pystr(s):
|
def _to_pystr(s):
|
||||||
if s != None:
|
if s != None:
|
||||||
enc = sys.stdout.encoding
|
enc = sys.stdout.encoding
|
||||||
if enc != None: return s.decode(enc)
|
return s.decode(enc if enc != None else 'latin-1')
|
||||||
else: return s.decode('latin-1')
|
|
||||||
else:
|
else:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue