Skip to content

Commit 0184e21

Browse files
authored
Upgrade pytype version to the latest (#636)
1 parent 02c3520 commit 0184e21

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

scripts/run_pytype.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ script_dir=$(dirname $0)
55
cd ${script_dir}/.. && \
66
pip install -e ".[async]" && \
77
pip install -e ".[adapter]" && \
8-
pip install "pytype==2022.3.8" && \
8+
pip install "pytype==2022.4.15" && \
99
pytype slack_bolt/

slack_bolt/app/app.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,13 +1453,19 @@ def do_GET(self):
14531453
request_path, _, query = self.path.partition("?")
14541454
if request_path == _bolt_oauth_flow.install_path:
14551455
bolt_req = BoltRequest(
1456-
body="", query=query, headers=self.headers
1456+
body="",
1457+
query=query,
1458+
# email.message.Message's mapping interface is dict compatible
1459+
headers=self.headers, # type:ignore
14571460
)
14581461
bolt_resp = _bolt_oauth_flow.handle_installation(bolt_req)
14591462
self._send_bolt_response(bolt_resp)
14601463
elif request_path == _bolt_oauth_flow.redirect_uri_path:
14611464
bolt_req = BoltRequest(
1462-
body="", query=query, headers=self.headers
1465+
body="",
1466+
query=query,
1467+
# email.message.Message's mapping interface is dict compatible
1468+
headers=self.headers, # type:ignore
14631469
)
14641470
bolt_resp = _bolt_oauth_flow.handle_callback(bolt_req)
14651471
self._send_bolt_response(bolt_resp)
@@ -1477,7 +1483,10 @@ def do_POST(self):
14771483
len_header = self.headers.get("Content-Length") or 0
14781484
request_body = self.rfile.read(int(len_header)).decode("utf-8")
14791485
bolt_req = BoltRequest(
1480-
body=request_body, query=query, headers=self.headers
1486+
body=request_body,
1487+
query=query,
1488+
# email.message.Message's mapping interface is dict compatible
1489+
headers=self.headers, # type:ignore
14811490
)
14821491
bolt_resp: BoltResponse = _bolt_app.dispatch(bolt_req)
14831492
self._send_bolt_response(bolt_resp)
@@ -1503,7 +1512,7 @@ def _send_response(
15031512
for k, vs in headers.items():
15041513
for v in vs:
15051514
self.send_header(k, v)
1506-
self.send_header("Content-Length", len(body_bytes))
1515+
self.send_header("Content-Length", str(len(body_bytes)))
15071516
self.end_headers()
15081517
self.wfile.write(body_bytes)
15091518

0 commit comments

Comments
 (0)