Add support for Python 3.12

This commit is contained in:
Ivan Kravets
2023-12-08 20:18:29 +02:00
parent 4cad98601d
commit 998da59f7c
3 changed files with 6 additions and 5 deletions

View File

@ -20,6 +20,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
6.1.12 (2023-??-??)
~~~~~~~~~~~~~~~~~~~
* Added support for Python 3.12
* Introduced a warning during the verification of MCU maximum RAM usage, signaling when the allocated RAM surpasses 100% (`issue #4791 <https://github.com/platformio/platformio-core/issues/4791>`_)
* Drastically enhanced the speed of project building when operating in verbose mode (`issue #4783 <https://github.com/platformio/platformio-core/issues/4783>`_)
* Upgraded the build engine to the latest version of SCons (4.6.0) to improve build performance, reliability, and compatibility with other tools and systems (`release notes <https://github.com/SCons/scons/releases/tag/4.6.0>`__)

View File

@ -210,7 +210,7 @@ def change_filemtime(path, mtime):
def rmtree(path):
def _onerror(func, path, __):
def _onexc(func, path, _):
try:
st_mode = os.stat(path).st_mode
if st_mode & stat.S_IREAD:
@ -223,4 +223,5 @@ def rmtree(path):
err=True,
)
return shutil.rmtree(path, onerror=_onerror)
kwargs = {"onexc" if sys.version_info >= (3, 12) else "onerror": _onexc}
return shutil.rmtree(path, **kwargs)

View File

@ -170,9 +170,8 @@ def items_in_list(needle, haystack):
def parse_datetime(datestr):
if "T" in datestr and "Z" in datestr:
return datetime.datetime.strptime(datestr, "%Y-%m-%dT%H:%M:%SZ")
return datetime.datetime.strptime(datestr)
assert "T" in datestr and "Z" in datestr
return datetime.datetime.strptime(datestr, "%Y-%m-%dT%H:%M:%SZ")
def merge_dicts(d1, d2, path=None):