Skip to content

Commit 998da59

Browse files
committed
Add support for Python 3.12
1 parent 4cad986 commit 998da59

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

HISTORY.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test-driven methodologies, and modern toolchains for unrivaled success.
2020
6.1.12 (2023-??-??)
2121
~~~~~~~~~~~~~~~~~~~
2222

23+
* Added support for Python 3.12
2324
* 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>`_)
2425
* Drastically enhanced the speed of project building when operating in verbose mode (`issue #4783 <https://github.com/platformio/platformio-core/issues/4783>`_)
2526
* 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>`__)

platformio/fs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def change_filemtime(path, mtime):
210210

211211

212212
def rmtree(path):
213-
def _onerror(func, path, __):
213+
def _onexc(func, path, _):
214214
try:
215215
st_mode = os.stat(path).st_mode
216216
if st_mode & stat.S_IREAD:
@@ -223,4 +223,5 @@ def _onerror(func, path, __):
223223
err=True,
224224
)
225225

226-
return shutil.rmtree(path, onerror=_onerror)
226+
kwargs = {"onexc" if sys.version_info >= (3, 12) else "onerror": _onexc}
227+
return shutil.rmtree(path, **kwargs)

platformio/util.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,8 @@ def items_in_list(needle, haystack):
170170

171171

172172
def parse_datetime(datestr):
173-
if "T" in datestr and "Z" in datestr:
174-
return datetime.datetime.strptime(datestr, "%Y-%m-%dT%H:%M:%SZ")
175-
return datetime.datetime.strptime(datestr)
173+
assert "T" in datestr and "Z" in datestr
174+
return datetime.datetime.strptime(datestr, "%Y-%m-%dT%H:%M:%SZ")
176175

177176

178177
def merge_dicts(d1, d2, path=None):

0 commit comments

Comments
 (0)