mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
Fix syntax warning when using Python 3.12. (#7022)
This happens when generating the Python API and you are using Python 3.12 in the build environment: ``` .../z3/scripts/update_api.py:1828: SyntaxWarning: invalid escape sequence '\#' ``` This was a `DeprecationWarning` previously, but Python 3.12 changed it to a `SyntaxWarning` to make it more visible. The release notes indicate that this will be a syntax error in the future.
This commit is contained in:
parent
8192b327e1
commit
3422f44cea
|
@ -1895,10 +1895,10 @@ if _lib is None:
|
||||||
print(" - to the custom Z3_LIB_DIRS Python-builtin before importing the z3 module, e.g. via")
|
print(" - to the custom Z3_LIB_DIRS Python-builtin before importing the z3 module, e.g. via")
|
||||||
if sys.version < '3':
|
if sys.version < '3':
|
||||||
print(" import __builtin__")
|
print(" import __builtin__")
|
||||||
print(" __builtin__.Z3_LIB_DIRS = [ '/path/to/z3/lib/dir' ] \# directory containing libz3.%s" % _ext)
|
print(" __builtin__.Z3_LIB_DIRS = [ '/path/to/z3/lib/dir' ] # directory containing libz3.%s" % _ext)
|
||||||
else:
|
else:
|
||||||
print(" import builtins")
|
print(" import builtins")
|
||||||
print(" builtins.Z3_LIB_DIRS = [ '/path/to/z3/lib/dir' ] \# directory containing libz3.%s" % _ext)
|
print(" builtins.Z3_LIB_DIRS = [ '/path/to/z3/lib/dir' ] # directory containing libz3.%s" % _ext)
|
||||||
print(_failures)
|
print(_failures)
|
||||||
raise Z3Exception("libz3.%s not found." % _ext)
|
raise Z3Exception("libz3.%s not found." % _ext)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue