1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-21 10:26:06 +03:00

Make mkdir.py work under python3 versions below 3.5 (#8194)

* Make mkdir.py work unter python3 versions below 3.5
Because early versions of python3 did not have the optional arg "exist_ok" for "pathlib.Path(...).mkdir(...)" a build under this versions will abort with an error message.
This PR will modify the python script so that it works even under python 3.4 (and below).
This commit is contained in:
gneiss15 2021-07-09 12:09:33 +02:00 committed by GitHub
parent 2946ce055c
commit 95c6fbb054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,10 @@ def main():
parser.add_argument('dir', action='store', nargs='+') parser.add_argument('dir', action='store', nargs='+')
ns = parser.parse_args() ns = parser.parse_args()
for p in ns.dir: for p in ns.dir:
pathlib.Path(p).mkdir(parents=ns.parents, exist_ok=True) try:
pathlib.Path(p).mkdir(parents=ns.parents)
except FileExistsError:
pass
return 0 return 0
if __name__ == '__main__': if __name__ == '__main__':