File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 44# postinst script which compiles python scripts
55
66if which py3compile > /dev/null 2>&1 ; then
7- py3compile -p python3-pyhp-core
7+ py3compile -p python3-pyhp-core
88elif which python3 > /dev/null 2>&1 ; then
99 python3 -m compileall -q /usr/lib/python3/dist-packages/pyhp
1010fi
Original file line number Diff line number Diff line change 55
66case " $1 " in
77 remove|upgrade|deconfigure)
8- # clear cache
9- set +e
10- pyhp-backend clear > /dev/null 2>&1
11- ret=" $? "
12- set -e
13- case " $ret " in
14- 0) echo " Info: PyHP backend is a cache and has been cleared" ;;
15- 1) echo " Warning: Exception while clearing PyHP backend" ;;
16- 3) echo " Info: PyHP backend is not a cache and has not been cleared" ;;
17- * ) echo " Warning: Error while clearing PyHP backend" ;;
18- esac
8+ # clear cache if toml module is installed
9+ if which python3 > /dev/null 2>&1 && python3 -c " import toml" > /dev/null 2>&1 ; then
10+ set +e
11+ pyhp-backend clear > /dev/null 2>&1
12+ ret=" $? "
13+ set -e
14+ case " $ret " in
15+ 0) echo " Info: PyHP backend is a cache and has been cleared" ;;
16+ 1) echo " Warning: Exception while clearing PyHP backend" ;;
17+ 3) echo " Info: PyHP backend is not a cache and has not been cleared" ;;
18+ * ) echo " Warning: Error while clearing PyHP backend" ;;
19+ esac
20+ else
21+ echo " Info: not clearing PyHP backend because python3-toml is not installed"
22+ fi
1923
2024 # remove __pycache__
2125 if which py3clean > /dev/null 2>&1 ; then
You can’t perform that action at this time.
0 commit comments