Skip to content

Commit

Permalink
Add support for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 8, 2023
1 parent 4cad986 commit 998da59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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>`__)
Expand Down
5 changes: 3 additions & 2 deletions platformio/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -223,4 +223,5 @@ def _onerror(func, 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)
5 changes: 2 additions & 3 deletions platformio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 998da59

Please sign in to comment.