Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning for distutils module in craft auth command #563

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

girardinsamuel
Copy link
Contributor

@girardinsamuel girardinsamuel commented Mar 13, 2022

Fix #562.

Old copy_tree method doc:
https://docs.python.org/3/distutils/apiref.html#distutils.dir_util.copy_tree

New copytree method doc:
https://docs.python.org/3/library/shutil.html#shutil.copytree

The new method will complain if directory already exists when the old method was not complaining. To keep same behaviour we need to add, dirs_exists_ok=True argument to allow overriding. But this option is only available starting from Python 3.8. As Masonite is compatible with Python 3.7, we need to handle this case (this switch will be removed when 3.7 will be dropped by Masonite one day).

I am not a big fan of switches but here it's not that much of a problem IMO.

@girardinsamuel girardinsamuel self-assigned this Mar 13, 2022
@josephmancuso josephmancuso merged commit 6909def into MasoniteFramework:4.0 Mar 18, 2022
@girardinsamuel girardinsamuel deleted the fix/562 branch March 18, 2022 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix deprecation warning with distutils module
2 participants