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
pyflakes: undefined names, get_context() and main(), in multiprocessing #65189
Comments
Two warnings from pyflakes: diff -r 72889bf8531d Lib/multiprocessing/spawn.py
--- a/Lib/multiprocessing/spawn.py Tue Mar 18 13:21:29 2014 +0100
+++ b/Lib/multiprocessing/spawn.py Wed Mar 19 11:49:24 2014 +0100
@@ -64,6 +64,7 @@ def freeze_support():
Run code for process object if this in not the main process
'''
if is_forking(sys.argv):
+ # FIXME: main() is undefined
main()
sys.exit()
diff -r 72889bf8531d Lib/multiprocessing/synchronize.py
--- a/Lib/multiprocessing/synchronize.py Tue Mar 18 13:21:29 2014 +0100
+++ b/Lib/multiprocessing/synchronize.py Wed Mar 19 11:50:50 2014 +0100
@@ -51,7 +51,6 @@ class SemLock(object):
_rand = tempfile._RandomNameSequence()
def __init__(self, kind, value, maxvalue, *, ctx):
- ctx = ctx or get_context()
ctx = ctx.get_context()
unlink_now = sys.platform == 'win32' or ctx._name == 'fork'
for i in range(100): |
Serhiy suggested (msg214136): "Lib/multiprocessing/synchronize.py: It looks like multiprocessing.get_context() exists, but I don't see how it is defined. For main(), it should maybe be replaced with _main()? |
It is defined by: globals().update((name, getattr(context._default_context, name))
_main() has different signature. |
New changeset 619331c67638 by Richard Oudkerk in branch '3.4': |
Would it be possible to write a test? Le dimanche 23 mars 2014, Roundup Robot <report@bugs.python.org> a écrit :
|
New changeset bb6377db0a9e by Richard Oudkerk in branch '3.4': |
Can we close this issue? Or Richard wants to write a test? |
Testing the is_forking() requires cx_freeze or something similar, so it really cannot go in the test suite. I have tested it manually (after spending too long trying to get cx_freeze to work with a source build). It should be noted that on Unix freezing is currently only compatible with the default 'fork' start method. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: