Skip to content

Commit 770f127

Browse files
committed
Merge branch 'master' of github.com:pyflakes/pyflakes
Forgot to push the commit that increments to 1.5.0 when I made the release, and some changes have been made since then :(
2 parents 4dfa2b8 + 41148b4 commit 770f127

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

.appveyor.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,11 @@ install:
3030

3131
# pypy3-2.4.0 and pypy-2.6.1 are manually bootstrapped and tested
3232
- ps: (New-Object Net.WebClient).DownloadFile('https://bootstrap.pypa.io/get-pip.py', "$env:appveyor_build_folder\get-pip.py")
33-
- git clone https://github.com/pypa/setuptools/
34-
- cd setuptools
35-
- C:\pypy3-2.4.0-win32\pypy3 bootstrap.py
36-
- C:\pypy3-2.4.0-win32\pypy3 setup.py install
37-
- C:\pypy-2.6.1-win32\pypy bootstrap.py
38-
- C:\pypy-2.6.1-win32\pypy setup.py install
39-
- cd ..
33+
# errors are ignored due to https://github.com/pypa/pip/issues/2669#issuecomment-136405390
34+
# NOTE: If and when a new version of PyPy3 is released for Windows that
35+
# supports anything newer than Python 3.2, remove the setuptools pin.
36+
- ps: C:\pypy3-2.4.0-win32\pypy3 "$env:appveyor_build_folder\get-pip.py"; C:\pypy3-2.4.0-win32\pypy3 -m pip install -U --force-reinstall pip==8.1.2 "setuptools<30"; echo "ignore error"
37+
- ps: C:\pypy-2.6.1-win32\pypy "$env:appveyor_build_folder\get-pip.py"
4038

4139
build: off
4240

pyflakes/checker.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,19 +1337,12 @@ def EXCEPTHANDLER(self, node):
13371337
pass
13381338

13391339
def ANNASSIGN(self, node):
1340-
"""
1341-
Annotated assignments don't have annotations evaluated on function
1342-
scope, hence the custom implementation.
1343-
1344-
See: PEP 526.
1345-
"""
13461340
if node.value:
13471341
# Only bind the *targets* if the assignment has a value.
13481342
# Otherwise it's not really ast.Store and shouldn't silence
13491343
# UndefinedLocal warnings.
13501344
self.handleNode(node.target, node)
1351-
if not isinstance(self.scope, FunctionScope):
1352-
self.handleNode(node.annotation, node)
1345+
self.handleNode(node.annotation, node)
13531346
if node.value:
13541347
# If the assignment has value, handle the *value* now.
13551348
self.handleNode(node.value, node)

pyflakes/test/test_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,9 @@ def test_permissionDenied(self):
518518
If the source file is not readable, this is reported on standard
519519
error.
520520
"""
521+
if os.getuid() == 0:
522+
self.skipTest('root user can access all files regardless of '
523+
'permissions')
521524
sourcePath = self.makeTempFile('')
522525
os.chmod(sourcePath, 0)
523526
count, errors = self.getErrors(sourcePath)

pyflakes/test/test_other.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,13 +1839,18 @@ def f():
18391839
name: str = 'Bob'
18401840
age: int = 18
18411841
foo: not_a_real_type = None
1842-
''', m.UnusedVariable, m.UnusedVariable, m.UnusedVariable)
1842+
''', m.UnusedVariable, m.UnusedVariable, m.UnusedVariable, m.UndefinedName)
18431843
self.flakes('''
18441844
def f():
18451845
name: str
18461846
print(name)
18471847
''', m.UndefinedName)
18481848
self.flakes('''
1849+
from typing import Any
1850+
def f():
1851+
a: Any
1852+
''')
1853+
self.flakes('''
18491854
foo: not_a_real_type
18501855
''', m.UndefinedName)
18511856
self.flakes('''

0 commit comments

Comments
 (0)