This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Fix typechecking errors introduced in #14128 #14455
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add TLS support for generic worker endpoints. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,8 +221,6 @@ class HomeServer(metaclass=abc.ABCMeta): | |
# instantiated during setup() for future return by get_datastores() | ||
DATASTORE_CLASS = abc.abstractproperty() | ||
|
||
tls_server_context_factory: Optional[IOpenSSLContextFactory] | ||
|
||
def __init__( | ||
self, | ||
hostname: str, | ||
|
@@ -258,6 +256,9 @@ def __init__( | |
self._module_web_resources: Dict[str, Resource] = {} | ||
self._module_web_resources_consumed = False | ||
|
||
# This attribute is set by the free function `refresh_certificate`. | ||
self.tls_server_context_factory: Optional[IOpenSSLContextFactory] = None | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually this might be redundant; I think mypy infers the type of instance attributes if they're set in the constructor like this? 🤷 |
||
|
||
def register_module_web_resource(self, path: str, resource: Resource) -> None: | ||
"""Allows a module to register a web resource to be served at the given path. | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar with ABCMeta but I don't think this should have magically an instance attribute?
(What I'm driving at is: why didn't complement fall over on #14128 but did on an earlier version of this PR?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regardless of
ABCMeta
I would think this would end up as an expected property? But yeah there's no guarantee it actually gets added unless we do it in__init__
.(Using a free function to set it is kind of meh...)