cargo_wrapper.py: added python3 version check for right usage of shutil.move(..)

This commit is contained in:
Klaas Jan Russcher 2022-05-27 21:34:35 +02:00
parent ab01fc6143
commit f327053811

View file

@ -135,4 +135,9 @@ if __name__ == "__main__":
dest = uninstalled / P(f).name
if dest.exists():
dest.unlink()
shutil.move(f, uninstalled)
# move() takes paths from Python3.9 on
if ((sys.version_info.major >= 3) and (sys.version_info.minor >= 9)):
shutil.move(f, uninstalled)
else:
shutil.move(str(f), str(uninstalled))