Merge branch 'distutils' into 'master'

Replace distutils.dir_util.copy_tree with shutil.copytree

See merge request openlp/openlp!242
This commit is contained in:
Tomas Groth 2020-09-28 07:12:29 +00:00
commit 8c888b9a00

View File

@ -24,8 +24,6 @@ This is the main window, where all the action happens.
import os import os
import shutil import shutil
from datetime import datetime from datetime import datetime
from distutils import dir_util
from distutils.errors import DistutilsFileError
from pathlib import Path from pathlib import Path
from tempfile import gettempdir from tempfile import gettempdir
@ -1359,9 +1357,9 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, LogMixin, RegistryPropert
self.show_status_message( self.show_status_message(
translate('OpenLP.MainWindow', 'Copying OpenLP data to new data directory location - {path} ' translate('OpenLP.MainWindow', 'Copying OpenLP data to new data directory location - {path} '
'- Please wait for copy to finish').format(path=self.new_data_path)) '- Please wait for copy to finish').format(path=self.new_data_path))
dir_util.copy_tree(str(old_data_path), str(self.new_data_path)) shutil.copytree(str(old_data_path), str(self.new_data_path))
self.log_info('Copy successful') self.log_info('Copy successful')
except (OSError, DistutilsFileError) as why: except (OSError, shutil.Error) as why:
self.application.set_normal_cursor() self.application.set_normal_cursor()
self.log_exception('Data copy failed {err}'.format(err=str(why))) self.log_exception('Data copy failed {err}'.format(err=str(why)))
err_text = translate('OpenLP.MainWindow', err_text = translate('OpenLP.MainWindow',