Skip to content

Conversation

@emeryberger
Copy link
Member

Fixes #914.

if __name__ == '__main__':
freeze_support()
with Pool(processes=cpu_count()) as pool:
for res in pool.map(process_xref_file_worker, range(10)):

Check notice

Code scanning / CodeQL

Unused global variable Note test

The global variable 'res' is not used.

Copilot Autofix

AI about 1 month ago

To resolve this issue, replace the unused variable res in the for loop with the conventional underscore (_). This makes it clear to readers and static analysis tools that the value produced by the loop is intentionally ignored. The change requires updating line 10 in the file test/issues/test-issue914.py, replacing for res in ... with for _ in .... No further code modifications are necessary, as the rest of the code is unaffected.


Suggested changeset 1
test/issues/test-issue914.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/test/issues/test-issue914.py b/test/issues/test-issue914.py
--- a/test/issues/test-issue914.py
+++ b/test/issues/test-issue914.py
@@ -7,6 +7,6 @@
 if __name__ == '__main__':
     freeze_support()
     with Pool(processes=cpu_count()) as pool:
-        for res in pool.map(process_xref_file_worker, range(10)):
+        for _ in pool.map(process_xref_file_worker, range(10)):
             pass
     
EOF
@@ -7,6 +7,6 @@
if __name__ == '__main__':
freeze_support()
with Pool(processes=cpu_count()) as pool:
for res in pool.map(process_xref_file_worker, range(10)):
for _ in pool.map(process_xref_file_worker, range(10)):
pass

Copilot is powered by AI and may make mistakes. Always verify output.
@emeryberger emeryberger merged commit 9a8cfb8 into master Oct 30, 2025
29 of 39 checks passed
zyrxvo added a commit to zyrxvo/scalene that referenced this pull request Nov 5, 2025
* Bumped version.

* Fix for pickling support (multiprocessing issue on Windows) (plasma-umass#954)

* Pickling support for multiprocessing, fixes 914.

* Modified MWE from 914 to properly freeze state, per documentation.

* Format code with black

* Bumped CI to 3.14. (plasma-umass#955)

* Document support for 3.14.

* Force NumPy version 2 for Python 3.14.

---------

Co-authored-by: Emery Berger <emery.berger@gmail.com>
Co-authored-by: emeryberger <emeryberger@users.noreply.github.com>
zyrxvo added a commit to zyrxvo/scalene that referenced this pull request Nov 14, 2025
* Bumped version.

* Fix for pickling support (multiprocessing issue on Windows) (plasma-umass#954)

* Pickling support for multiprocessing, fixes 914.

* Modified MWE from 914 to properly freeze state, per documentation.

* Format code with black

* Bumped CI to 3.14. (plasma-umass#955)

* Document support for 3.14.

* Force NumPy version 2 for Python 3.14.

* Move to macos-latest (per https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/).

* Updated dep for Python>=3.9

* Restore 3.8 support (plasma-umass#958)

* Updated to see if 3.8 can still be supported.

* One more update.

* Format code with black

---------

Co-authored-by: Emery Berger <emery.berger@gmail.com>
Co-authored-by: emeryberger <emeryberger@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiprocessing OS Error, Can't Pickle. Windows 10

2 participants