mirror of
https://github.com/Z3Prover/z3
synced 2026-02-22 16:27:37 +00:00
Fix Priority 1 ASSERT_FAIL bugs - replace assertions with proper error handling
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
b5b79343e4
commit
92d684e942
4 changed files with 43 additions and 25 deletions
|
|
@ -3594,10 +3594,11 @@ class MakeRuleCmd(object):
|
|||
def strip_path_prefix(path, prefix):
|
||||
if path.startswith(prefix):
|
||||
stripped_path = path[len(prefix):]
|
||||
stripped_path.replace('//','/')
|
||||
if stripped_path[0] == '/':
|
||||
stripped_path = stripped_path.replace('//','/')
|
||||
if len(stripped_path) > 0 and stripped_path[0] == '/':
|
||||
stripped_path = stripped_path[1:]
|
||||
assert not os.path.isabs(stripped_path)
|
||||
if os.path.isabs(stripped_path):
|
||||
raise ValueError(f"Path '{path}' after stripping prefix '{prefix}' is still absolute: '{stripped_path}'")
|
||||
return stripped_path
|
||||
else:
|
||||
return path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue