Cleanup: take advantage of pathlib

* Use / syntax for concating pathlib paths in tests
* Use .name for getting last component of pathlib path
This commit is contained in:
gandalf3
2017-06-29 02:11:43 -07:00
parent 172353bbbb
commit 5a0aba8a56
2 changed files with 9 additions and 9 deletions

View File

@@ -50,7 +50,7 @@ def extract_blinfo(path: pathlib.Path) -> dict:
source = None
# get last component of path
addon_name = path.parts[-1]
addon_name = path.name
if path.is_dir():
with open(path / '__init__.py', 'r') as f:
@@ -87,7 +87,7 @@ def make_repo(repopath: pathlib.Path):
for addon_path in repopath.iterdir():
package_datum = {}
addon = addon_path.parts[-1]
addon = addon_path.name
try:
bl_info = extract_blinfo(addon_path)