Commit 6f59f10f authored by Hackenberg Stefan (IFAG DSS TI SWP NTV)'s avatar Hackenberg Stefan (IFAG DSS TI SWP NTV)
Browse files

Add fix for framework-mbed and python3.9

parent 6e0851e7
......@@ -25,13 +25,37 @@ the mbed Developer Community.
http://mbed.org/
"""
from os.path import join
import os
from SCons.Script import Import, SConscript
Import("env")
def fixi():
"""Fix intelhex compat issue in framework-mbed 5 with python3.9"""
compat = os.path.join(
env.PioPlatform().get_package_dir("framework-mbed"),
'platformio',
'package_deps',
'py3',
'intelhex',
'compat.py'
)
with open(compat) as fp:
content = fp.read()
if 'array_tobytes = getattr(array.array, "tobytes", array.array.tostring)' in content:
content = content.replace(
'array_tobytes = getattr(array.array, "tobytes", array.array.tostring)',
'array_tobytes = getattr(array.array, "tobytes", array.array.tobytes)',
)
with open(compat, 'w') as fp:
fp.write(content)
fixi()
def applymbedignore():
import mbedignore
mbedignorefile = env.subst('$PROJECT_DIR/.mbedignore')
......@@ -40,7 +64,9 @@ def applymbedignore():
applymbedignore()
# https://github.com/platformio/builder-framework-mbed.git
SConscript(
join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio",
os.path.join(env.PioPlatform().get_package_dir("framework-mbed"), "platformio",
"platformio-build.py"))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment