Skip to content

Commit 9957202

Browse files
authored
Cleanup lgtm errors (aio-libs#3902)
1 parent 637db70 commit 9957202

File tree

6 files changed

+16
-12
lines changed

6 files changed

+16
-12
lines changed

.lgtm.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
queries:
2+
- exclude: py/unsafe-cyclic-import

aiohttp/connector.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -975,9 +975,8 @@ async def _create_direct_connection(
975975
continue
976976

977977
return transp, proto
978-
else:
979-
assert last_exc is not None
980-
raise last_exc
978+
assert last_exc is not None
979+
raise last_exc
981980

982981
async def _create_proxy_connection(
983982
self,

aiohttp/worker.py

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ async def _run(self) -> None:
8282

8383
ctx = self._create_ssl_context(self.cfg) if self.cfg.is_ssl else None
8484

85-
runner = runner
8685
assert runner is not None
8786
server = runner.server
8887
assert server is not None

examples/fake_server.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ async def main(loop):
9898
fake_facebook = FakeFacebook()
9999
info = await fake_facebook.start()
100100
resolver = FakeResolver(info)
101-
connector = aiohttp.TCPConnector(resolver=resolver,
102-
verify_ssl=False)
101+
connector = aiohttp.TCPConnector(resolver=resolver, ssl=False)
103102

104103
async with aiohttp.ClientSession(connector=connector) as session:
105104
async with session.get('https://graph.facebook.com/v2.7/me',

examples/web_cookies.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ async def logout(request):
3434
return resp
3535

3636

37-
def init(loop):
38-
app = web.Application(loop=loop)
37+
def init():
38+
app = web.Application()
3939
app.router.add_get('/', root)
4040
app.router.add_get('/login', login)
4141
app.router.add_get('/logout', logout)

tools/gen.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22

33
import aiohttp
44
import pathlib
5-
from aiohttp import hdrs
5+
import aiohttp.hdrs
6+
import multidict
67
from collections import defaultdict
78
import io
89

9-
headers = [getattr(hdrs, name)
10-
for name in dir(hdrs)
11-
if isinstance(getattr(hdrs, name), hdrs.istr)]
10+
headers = [getattr(aiohttp.hdrs, name)
11+
for name in dir(aiohttp.hdrs)
12+
if isinstance(getattr(aiohttp.hdrs, name), multidict.istr)]
13+
1214

1315
def factory():
1416
return defaultdict(factory)
@@ -26,6 +28,7 @@ def build(headers):
2628
d[TERMINAL] = hdr
2729
return dct
2830

31+
2932
dct = build(headers)
3033

3134

@@ -82,6 +85,7 @@ def build(headers):
8285
}}
8386
"""
8487

88+
8589
def gen_prefix(prefix, k):
8690
if k == '-':
8791
return prefix + '_'
@@ -148,6 +152,7 @@ def gen_headers(headers):
148152
# print(gen(dct).getvalue())
149153
# print(gen_headers(headers).getvalue())
150154

155+
151156
folder = pathlib.Path(aiohttp.__file__).parent
152157

153158
with (folder / '_find_header.c').open('w') as f:

0 commit comments

Comments
 (0)