mirror of https://github.com/zulip/zulip.git
mypy: Add Optional to tornado/descriptors.py; remove from mypy.ini.
This commit is contained in:
parent
d48fbb3f63
commit
482383b6f7
3
mypy.ini
3
mypy.ini
|
@ -115,9 +115,6 @@ strict_optional = False
|
|||
[mypy-zerver.tornado.handlers] # Delayed setup of ASyncDjangoHandler._request_middleware (Optional), line 200 error
|
||||
strict_optional = False
|
||||
|
||||
[mypy-zerver.tornado.descriptors] # line 10: 'get' can return None; only used in zerver/tornado/handlers?
|
||||
strict_optional = False
|
||||
|
||||
# Tests (may be many issues in file; comment is just one error noted)
|
||||
|
||||
[mypy-zerver/tests/test_tornado] #202: error: Item "None" of "Optional[Morsel[Any]]" has no attribute "coded_value"
|
||||
|
|
|
@ -6,7 +6,7 @@ if False:
|
|||
|
||||
descriptors_by_handler_id = {} # type: Dict[int, ClientDescriptor]
|
||||
|
||||
def get_descriptor_by_handler_id(handler_id: int) -> 'ClientDescriptor':
|
||||
def get_descriptor_by_handler_id(handler_id: int) -> Optional['ClientDescriptor']:
|
||||
return descriptors_by_handler_id.get(handler_id)
|
||||
|
||||
def set_descriptor_by_handler_id(handler_id: int,
|
||||
|
|
Loading…
Reference in New Issue