Skip to content

Replaced os module with pathlib for paths#14553

Closed
AliMuhammadOfficial wants to merge 1 commit intodjango:mainfrom
AliMuhammadOfficial:main
Closed

Replaced os module with pathlib for paths#14553
AliMuhammadOfficial wants to merge 1 commit intodjango:mainfrom
AliMuhammadOfficial:main

Conversation

@AliMuhammadOfficial
Copy link
Copy Markdown

No description provided.

@github-actions
Copy link
Copy Markdown

Hello @AliMuhammadOfficial! Thank you for your contribution 💪

As it's your first contribution be sure to check out the patch review checklist.

If you're fixing a ticket from Trac make sure to set the "Has patch" flag and include a link to this PR in the ticket!

If you have any design or process questions then you can ask in the Django forum.

Welcome aboard ⛵️!

Comment on lines +18 to +19
existing_path = Path.absolute(Path.joinpath(lib_path, "django"))
if Path.exists(existing_path):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this to look more like the following:

Suggested change
existing_path = Path.absolute(Path.joinpath(lib_path, "django"))
if Path.exists(existing_path):
path = Path(lib_path) / 'django'
if path.absolute().exists():

Or potentially:

Suggested change
existing_path = Path.absolute(Path.joinpath(lib_path, "django"))
if Path.exists(existing_path):
if Path(lib_path).joinpath('django').absolute().exists():

But also note that pathlib.Path.absolute() is not (currently) documented, public API.

@ngnpope
Copy link
Copy Markdown
Member

ngnpope commented Jun 22, 2021

Thanks for this @AliMuhammadOfficial, but, at this stage, I don't think changing this over to pathlib is worthwhile.

@ngnpope ngnpope closed this Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants