mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-11 01:41:57 -04:00
quickfix to disallow running borg with assertions switched off, see #8649
forward port of #8685 to master branch.
This commit is contained in:
parent
4f38dc6031
commit
13b7e1f5a8
1 changed files with 11 additions and 0 deletions
|
|
@ -3,6 +3,17 @@
|
|||
import sys
|
||||
import traceback
|
||||
|
||||
# quickfix to disallow running borg with assertions switched off
|
||||
try:
|
||||
assert False
|
||||
except AssertionError:
|
||||
pass # OK
|
||||
else:
|
||||
print(
|
||||
"Borg requires working assertions. Please run Python without -O and/or unset PYTHONOPTIMIZE.", file=sys.stderr
|
||||
)
|
||||
sys.exit(2) # == EXIT_ERROR
|
||||
|
||||
try:
|
||||
import argparse
|
||||
import faulthandler
|
||||
|
|
|
|||
Loading…
Reference in a new issue