Remove path workarounds for old python versions

This commit is contained in:
Simon Brand 2023-02-15 19:25:48 +00:00 committed by Jochen Sprickerhof
parent c5ba4bc848
commit 4a581bdfb6
11 changed files with 79 additions and 110 deletions

View file

@ -264,8 +264,7 @@ def main():
if Path('build.gradle').exists() or Path('build.gradle.kts').exists():
build.gradle = ['yes']
# TODO: Python3.6: Should accept path-like
git_repo = git.Repo(str(Path.cwd()))
git_repo = git.Repo(Path.cwd())
for remote in git.Remote.iter_items(git_repo):
if remote.name == 'origin':
url = git_repo.remotes.origin.url
@ -277,8 +276,7 @@ def main():
elif options.url:
app = get_app_from_url(options.url)
tmp_importer_dir = clone_to_tmp_dir(app)
# TODO: Python3.6: Should accept path-like
git_repo = git.Repo(str(tmp_importer_dir))
git_repo = git.Repo(tmp_importer_dir)
if not options.omit_disable:
build.disable = 'Generated by import.py - check/set version fields and commit id'
@ -387,8 +385,7 @@ def main():
git_repo.close()
except AttributeError: # Debian/stretch's version does not have close()
pass
# TODO: Python3.9: Accepts a path-like object for both src and dst.
shutil.move(str(tmp_importer_dir), str(build_dir))
shutil.move(tmp_importer_dir, build_dir)
Path('build/.fdroidvcs-' + appid).write_text(app.RepoType + ' ' + app.Repo)
metadatapath = Path('metadata') / (appid + '.yml')