core icon indicating copy to clipboard operation
core copied to clipboard

Use os.path.dirname() for getting the directory name of a path

Open akx opened this issue 3 years ago • 0 comments

Proposed change

Very tiny change I noticed while grepping for splits in #81493 – the meaning of os.path.dirname(...) is more easy to understand than os.path.split(...)[0].

Type of change

  • [ ] Dependency upgrade
  • [ ] Bugfix (non-breaking change which fixes an issue)
  • [ ] New integration (thank you!)
  • [ ] New feature (which adds functionality to an existing integration)
  • [ ] Deprecation (breaking change to happen in the future)
  • [ ] Breaking change (fix/feature causing existing functionality to break)
  • [x] Code quality improvements to existing code or addition of tests

Checklist

  • [x] The code change is tested and works locally.
  • [ ] Local tests pass. Your PR cannot be merged unless tests pass
  • [x] There is no commented out code in this PR.
  • [x] I have followed the development checklist
  • [x] The code has been formatted using Black (black --fast homeassistant tests)
  • [ ] Tests have been added to verify that the new code works.
    • Nothing new to test.

To help with the load of incoming pull requests:

akx avatar Nov 03 '22 20:11 akx