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

pyflakes: undefined names #65177

Closed
vstinner opened this issue Mar 19, 2014 · 7 comments
Closed

pyflakes: undefined names #65177

vstinner opened this issue Mar 19, 2014 · 7 comments

Comments

@vstinner
Copy link
Member

vstinner commented Mar 19, 2014

BPO 20978
Nosy @vstinner, @serhiy-storchaka
Files
  • undefined.patch
  • 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:

    assignee = None
    closed_at = <Date 2014-03-20.08:30:16.955>
    created_at = <Date 2014-03-19.10:52:38.361>
    labels = []
    title = 'pyflakes: undefined names'
    updated_at = <Date 2014-03-20.08:44:14.171>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2014-03-20.08:44:14.171>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2014-03-20.08:30:16.955>
    closer = 'vstinner'
    components = []
    creation = <Date 2014-03-19.10:52:38.361>
    creator = 'vstinner'
    dependencies = []
    files = ['34512']
    hgrepos = []
    issue_num = 20978
    keywords = ['patch']
    message_count = 7.0
    messages = ['214075', '214136', '214181', '214184', '214188', '214191', '214192']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'jnoller', 'python-dev', 'sbt', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue20978'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    @vstinner
    Copy link
    Member Author

    vstinner commented Mar 19, 2014

    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):

    @serhiy-storchaka
    Copy link
    Member

    serhiy-storchaka commented Mar 19, 2014

    LGTM.

    Lib/multiprocessing/synchronize.py:

    Add at the start of the file:

    from . import get_context

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 20, 2014

    New changeset 6718d00b872b by Victor Stinner in branch '3.4':
    Issue bpo-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 bpo-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 bpo-20978: pyflakes: fix undefined names; remove last part of
    http://hg.python.org/cpython/rev/52404c14be07

    @vstinner
    Copy link
    Member Author

    vstinner commented Mar 20, 2014

    I created bpo-20990 for the undefined names in multiprocessing.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 20, 2014

    New changeset bdad874195d6 by Victor Stinner in branch '3.4':
    Isuse bpo-12328, bpo-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 bpo-12328, bpo-20978: Add _winapi.WAIT_ABANDONED_0 symbol, needed
    http://hg.python.org/cpython/rev/2e4692a762d5

    @serhiy-storchaka
    Copy link
    Member

    serhiy-storchaka commented Mar 20, 2014

    What about 2.7?

    @vstinner
    Copy link
    Member Author

    vstinner commented Mar 20, 2014

    What about 2.7?

    Python 2.7 is not affected.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    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

    No branches or pull requests

    2 participants