Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
a423f452
Unverified
Commit
a423f452
authored
2 years ago
by
David Robertson
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix twisted trunk mypy errors (#14012)
parent
7f4f2a37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
changelog.d/14012.misc
+1
-0
1 addition, 0 deletions
changelog.d/14012.misc
synapse/handlers/cas.py
+3
-0
3 additions, 0 deletions
synapse/handlers/cas.py
synapse/handlers/ui_auth/checkers.py
+3
-0
3 additions, 0 deletions
synapse/handlers/ui_auth/checkers.py
with
7 additions
and
0 deletions
changelog.d/14012.misc
0 → 100644
+
1
−
0
View file @
a423f452
Fix type annotations to be compatible with new annotations in development versions of twisted.
This diff is collapsed.
Click to expand it.
synapse/handlers/cas.py
+
3
−
0
View file @
a423f452
...
@@ -130,6 +130,9 @@ class CasHandler:
...
@@ -130,6 +130,9 @@ class CasHandler:
except
PartialDownloadError
as
pde
:
except
PartialDownloadError
as
pde
:
# Twisted raises this error if the connection is closed,
# Twisted raises this error if the connection is closed,
# even if that's being used old-http style to signal end-of-data
# even if that's being used old-http style to signal end-of-data
# Assertion is for mypy's benefit. Error.response is Optional[bytes],
# but a PartialDownloadError should always have a non-None response.
assert
pde
.
response
is
not
None
body
=
pde
.
response
body
=
pde
.
response
except
HttpResponseException
as
e
:
except
HttpResponseException
as
e
:
description
=
(
description
=
(
...
...
This diff is collapsed.
Click to expand it.
synapse/handlers/ui_auth/checkers.py
+
3
−
0
View file @
a423f452
...
@@ -119,6 +119,9 @@ class RecaptchaAuthChecker(UserInteractiveAuthChecker):
...
@@ -119,6 +119,9 @@ class RecaptchaAuthChecker(UserInteractiveAuthChecker):
except
PartialDownloadError
as
pde
:
except
PartialDownloadError
as
pde
:
# Twisted is silly
# Twisted is silly
data
=
pde
.
response
data
=
pde
.
response
# For mypy's benefit. A general Error.response is Optional[bytes], but
# a PartialDownloadError.response should be bytes AFAICS.
assert
data
is
not
None
resp_body
=
json_decoder
.
decode
(
data
.
decode
(
"
utf-8
"
))
resp_body
=
json_decoder
.
decode
(
data
.
decode
(
"
utf-8
"
))
if
"
success
"
in
resp_body
:
if
"
success
"
in
resp_body
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment