Merge pull request #8778 from ThomasWaldmann/assert-quickfix-master

quickfix to disallow running borg with assertions switched off, see #8649
This commit is contained in:
TW 2025-04-21 18:34:27 +02:00 committed by GitHub
commit b5e95daccf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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