2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-12 00:06:36 +00:00

Merge pull request #723 from Thunderbottom/fix-reload

[fix] reload(): use importlib for python3
This commit is contained in:
Ameya Shenoy 2018-09-22 03:19:46 +05:30 committed by GitHub
commit fae7d49060
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -387,6 +387,8 @@ def switch_branch(branch, apps=None, bench_path='.', upgrade=False, check_upgrad
print("Successfully switched branches for:\n" + "\n".join(switched_apps)) print("Successfully switched branches for:\n" + "\n".join(switched_apps))
if version_upgrade[0] and upgrade: if version_upgrade[0] and upgrade:
if sys.version_info >= (3, 4):
from importlib import reload
update_requirements() update_requirements()
update_node_packages() update_node_packages()
pre_upgrade(version_upgrade[1], version_upgrade[2]) pre_upgrade(version_upgrade[1], version_upgrade[2])

View File

@ -77,6 +77,8 @@ def _update(pull=False, patch=False, build=False, update_bench=False, auto=False
update_node_packages(bench_path=bench_path) update_node_packages(bench_path=bench_path)
if version_upgrade[0] or (not version_upgrade[0] and force): if version_upgrade[0] or (not version_upgrade[0] and force):
if sys.version_info >= (3, 4):
from importlib import reload
pre_upgrade(version_upgrade[1], version_upgrade[2], bench_path=bench_path) pre_upgrade(version_upgrade[1], version_upgrade[2], bench_path=bench_path)
import bench.utils, bench.app import bench.utils, bench.app
print('Reloading bench...') print('Reloading bench...')