Skip to content

Commit

Permalink
Fix syntax warning when using Python 3.12. (#7022)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
waywardmonkeys committed Nov 28, 2023
1 parent 8192b32 commit 3422f44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/update_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1895,10 +1895,10 @@ def write_core_py_preamble(core_py):
print(" - to the custom Z3_LIB_DIRS Python-builtin before importing the z3 module, e.g. via")
if sys.version < '3':
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:
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)
raise Z3Exception("libz3.%s not found." % _ext)
Expand Down

0 comments on commit 3422f44

Please sign in to comment.