This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pyflakes: undefined names
Type: Stage: patch review
Components: Versions: Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jnoller, python-dev, sbt, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2014-03-19 10:52 by vstinner, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
undefined.patch vstinner, 2014-03-19 10:52
Messages (7)
msg214075 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-03-19 10:52
I ran pyflakes on Python 3.5. Attached patch fixes some undefined names warnings.

I don't know what to with these two warnings, they look to be false positive:

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):
msg214136 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-03-19 21:07
LGTM.

Lib/multiprocessing/synchronize.py:

Add at the start of the file:

from . import get_context
msg214181 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-20 07:55
New changeset 6718d00b872b by Victor Stinner in branch '3.4':
Issue #20978: Remove last part of OS/2 support in distutils
http://hg.python.org/cpython/rev/6718d00b872b

New changeset 8de5d0809dd8 by Victor Stinner in branch '3.4':
Issue #20978: pyflakes: fix undefined names
http://hg.python.org/cpython/rev/8de5d0809dd8

New changeset 52404c14be07 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #20978: pyflakes: fix undefined names; remove last part of
http://hg.python.org/cpython/rev/52404c14be07
msg214184 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-03-20 08:06
I created #20990 for the undefined names in multiprocessing.
msg214188 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-20 08:28
New changeset bdad874195d6 by Victor Stinner in branch '3.4':
Isuse #12328, #20978: Add _winapi.WAIT_ABANDONED_0 symbol, needed by
http://hg.python.org/cpython/rev/bdad874195d6

New changeset 2e4692a762d5 by Victor Stinner in branch 'default':
(Merge 3.4) Issue #12328, #20978: Add _winapi.WAIT_ABANDONED_0 symbol, needed
http://hg.python.org/cpython/rev/2e4692a762d5
msg214191 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-03-20 08:37
What about 2.7?
msg214192 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2014-03-20 08:44
> What about 2.7?

Python 2.7 is not affected.
History
Date User Action Args
2022-04-11 14:58:00adminsetgithub: 65177
2014-03-20 08:44:14vstinnersetmessages: + msg214192
2014-03-20 08:37:03serhiy.storchakasetmessages: + msg214191
2014-03-20 08:30:16vstinnersetstatus: open -> closed
resolution: fixed
2014-03-20 08:28:43python-devsetnosy: + python-dev
messages: + msg214188
2014-03-20 08:06:09vstinnersetnosy: - python-dev
messages: + msg214184
2014-03-20 07:55:49python-devsetnosy: + python-dev
messages: + msg214181
2014-03-19 21:07:07serhiy.storchakasetversions: + Python 2.7
nosy: + serhiy.storchaka

messages: + msg214136

stage: patch review
2014-03-19 10:52:38vstinnercreate