[Python-checkins] gh-103801: Tools/wasm linting and formatting (#103796)

gpshead webhook-mailer at python.org
Mon Apr 24 18:42:10 EDT 2023


https://github.com/python/cpython/commit/01be52e42eac468b6511b56ee60cd1b99baf3848
commit: 01be52e42eac468b6511b56ee60cd1b99baf3848
branch: main
author: Daniel Versoza <daniel.ve3 at gmail.com>
committer: gpshead <greg at krypto.org>
date: 2023-04-24T22:42:02Z
summary:

gh-103801: Tools/wasm linting and formatting (#103796)

This PR makes three minor linting adjustments to the `wasm` module
caught by [ruff](https://github.com/charliermarsh/ruff).

<!-- gh-issue-number: gh-103801 -->
* Issue: gh-103801
<!-- /gh-issue-number -->

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>

files:
A Misc/NEWS.d/next/Core and Builtins/2023-04-24-21-47-38.gh-issue-103801.WaBanq.rst
M Tools/wasm/wasm_assets.py
M Tools/wasm/wasm_build.py

diff --git a/Misc/NEWS.d/next/Core and Builtins/2023-04-24-21-47-38.gh-issue-103801.WaBanq.rst b/Misc/NEWS.d/next/Core and Builtins/2023-04-24-21-47-38.gh-issue-103801.WaBanq.rst
new file mode 100644
index 000000000000..6f07d72fafdf
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2023-04-24-21-47-38.gh-issue-103801.WaBanq.rst	
@@ -0,0 +1 @@
+Adds three minor linting fixes to the wasm module caught that were caught by ruff.
diff --git a/Tools/wasm/wasm_assets.py b/Tools/wasm/wasm_assets.py
index 9dc8bda4017e..1fc97fd5e70a 100755
--- a/Tools/wasm/wasm_assets.py
+++ b/Tools/wasm/wasm_assets.py
@@ -6,7 +6,8 @@
 
 - a stripped down, pyc-only stdlib zip file, e.g. {PREFIX}/lib/python311.zip
 - os.py as marker module {PREFIX}/lib/python3.11/os.py
-- empty lib-dynload directory, to make sure it is copied into the bundle {PREFIX}/lib/python3.11/lib-dynload/.empty
+- empty lib-dynload directory, to make sure it is copied into the bundle:
+    {PREFIX}/lib/python3.11/lib-dynload/.empty
 """
 
 import argparse
diff --git a/Tools/wasm/wasm_build.py b/Tools/wasm/wasm_build.py
index 493682c5b138..241a5d4eed5a 100755
--- a/Tools/wasm/wasm_build.py
+++ b/Tools/wasm/wasm_build.py
@@ -73,7 +73,7 @@
 run "make clean -C '{SRCDIR}'".
 """
 
-INSTALL_NATIVE = f"""
+INSTALL_NATIVE = """
 Builds require a C compiler (gcc, clang), make, pkg-config, and development
 headers for dependencies like zlib.
 
@@ -598,7 +598,7 @@ def run_browser(self, bind="127.0.0.1", port=8000):
         end = time.monotonic() + 3.0
         while time.monotonic() < end and srv.returncode is None:
             try:
-                with socket.create_connection((bind, port), timeout=0.1) as s:
+                with socket.create_connection((bind, port), timeout=0.1) as _:
                     pass
             except OSError:
                 time.sleep(0.01)



More information about the Python-checkins mailing list