Skip to content

Commit

Permalink
Added try, except block
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonBenAnderson committed Sep 5, 2023
1 parent fc31ea5 commit ed117ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drag_n_drop_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,14 @@ def start_install(self):

for item in os.listdir(mgear_folder):
# -- move the folder to the install path
shutil.move(os.path.join(
install_path, "mgear", item), install_path)
self.update_logging_widget("Moved: {0}".format(
os.path.join(install_path, item)))
try:
shutil.move(os.path.join(
install_path, "mgear", item), install_path)
self.update_logging_widget("Moved: {0}".format(
os.path.join(install_path, item)))
except OSError as err:
self.update_logging_widget("Warning: Failed to move {0}".format(
os.path.join(install_path, item)))

self.remove_directory(mgear_install_path)

Expand Down

0 comments on commit ed117ee

Please sign in to comment.