Skip to content

Commit 89db482

Browse files
committed
quickfix to disallow running borg with assertions switched off
Signed-off-by: Nish_ <120EE0980@nitrkl.ac.in>
1 parent 8e6dc52 commit 89db482

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/borg/archiver.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
import sys
44
import traceback
55

6+
# quickfix to disallow running borg with assertions switched off
7+
try:
8+
assert False
9+
except AssertionError:
10+
pass #OK
11+
else:
12+
print("Borg requires working assertions. Please run Python without -O and/or unset PYTHONOPTIMIZE")
13+
sys.exit(2) # == EXIT_ERROR
14+
615
try:
716
import argparse
817
import collections

0 commit comments

Comments
 (0)