import: fix error when using python3-git from stretch

closes https://gitlab.com/fdroid/issuebot/-/issues/48#note_646592031
closes issuebot#48
This commit is contained in:
Hans-Christoph Steiner 2021-08-09 16:22:49 +02:00
parent c4d3e075cb
commit 3283ce2510
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA

View file

@ -254,7 +254,10 @@ def main():
sys.exit(1) sys.exit(1)
elif tmp_importer_dir: elif tmp_importer_dir:
# For Windows: Close the repo or a git.exe instance holds handles to repo # For Windows: Close the repo or a git.exe instance holds handles to repo
git_repo.close() try:
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. # TODO: Python3.9: Accepts a path-like object for both src and dst.
shutil.move(str(tmp_importer_dir), str(build_dir)) shutil.move(str(tmp_importer_dir), str(build_dir))
Path('build/.fdroidvcs-' + appid).write_text(app.RepoType + ' ' + app.Repo) Path('build/.fdroidvcs-' + appid).write_text(app.RepoType + ' ' + app.Repo)