Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix busio example; update some scripts for Python 3.12 #8568

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/shared_bindings_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def build_module_map():
search_identifier = ADDITIONAL_MODULES[module]
else:
search_identifier = "CIRCUITPY_" + module.lstrip("_").upper()
re_pattern = f"{re.escape(search_identifier)}\s*\??=\s*(.+)"
re_pattern = fr"{re.escape(search_identifier)}\s*\??=\s*(.+)"
find_config = re.findall(re_pattern, configs)
if not find_config:
continue
Expand Down Expand Up @@ -242,12 +242,12 @@ def get_repository_url(directory):
with open(readme, "r") as fp:
for line in fp.readlines():
if m := re.match(
"\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*",
r"\s+:target:\s+(http\S+(docs.circuitpython|readthedocs)\S+)\s*",
line,
):
path = m.group(1)
break
if m := re.search("<(http[^>]+)>", line):
if m := re.search(r"<(http[^>]+)>", line):
path = m.group(1)
break
if path is None:
Expand Down
9 changes: 6 additions & 3 deletions shared-bindings/busio/__init__.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@
//| from board import *
//|
//| i2c = busio.I2C(SCL, SDA)
//| i2c.try_lock()
//| print(i2c.scan())
//| i2c.unlock()
//| i2c.deinit()
//|
//| This example will initialize the the device, run
//| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the
//| hardware. The last step is optional because CircuitPython automatically
//| This example will initialize the the device, lock the I2C bus, run
//| :py:meth:`~busio.I2C.scan`, unlock the bus,
//| and then :py:meth:`~busio.I2C.deinit` the hardware.
//| The last step is optional because CircuitPython automatically
//| resets hardware after a program finishes.
//|
//| Note that drivers will typically handle communication if provided the bus
Expand Down
2 changes: 1 addition & 1 deletion tools/build_release_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
# Flush so we will see something before 10 minutes has passed.
print(flush=True)

if (not build_all) and (language is LANGUAGE_FIRST) and (exit_status is 0):
if (not build_all) and (language == LANGUAGE_FIRST) and (exit_status == 0):
try:
with open(
f"../ports/{board_info['port']}/{build_dir}/firmware.size.json", "r"
Expand Down