Remove usage of deprecated distutils (#436)

* Remove usage of deprecated distutils

* remove unnecessary import
This commit is contained in:
Ultrasonic1209 2022-08-08 13:26:43 +01:00 committed by GitHub
parent ebc9067011
commit 7d2af597f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View file

@ -1,5 +1,4 @@
import os, shutil
from distutils import dir_util
user_path = os.path.expanduser("~")
cf_path = user_path + "/curseforge/minecraft/Instances/Fabulously Optimized/"
@ -12,7 +11,7 @@ packwiz_path = git_path + "Packwiz/" + minecraft_version
def remove_dir(path, description):
if os.path.isdir(path):
dir_util.remove_tree(path)
shutil.rmtree(path)
print("Deleted " + description)
else:
print("Skipped " + description + " deletion, didn't exist")
@ -26,7 +25,7 @@ def remove_file(path, description):
def copy_dir(from_path, to_path, from_desc, to_desc):
if os.path.isdir(from_path):
dir_util.copy_tree(from_path, to_path)
shutil.copytree(from_path, to_path)
print("Copied " + from_desc + " to " + to_desc)
else:
print("Skipped " + from_desc + " copying to " + to_desc + ", didn't exist")

View file

@ -1,5 +1,4 @@
import os, shutil, re, zipfile
from distutils import dir_util
user_path = os.path.expanduser("~")
mmc_path = user_path + "/Documents/MultiMC/instances/Fabulously Optimized/"