From 041754f8172a067a430be626b814a15451ebf329 Mon Sep 17 00:00:00 2001 From: Konstantin Alekseev Date: Sun, 1 Dec 2019 20:46:11 +0300 Subject: [PATCH] Fix smtp backend open (#240) --- django-stubs/core/mail/backends/base.pyi | 4 ++-- scripts/enabled_test_modules.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/django-stubs/core/mail/backends/base.pyi b/django-stubs/core/mail/backends/base.pyi index cd73f7a..2e3fd0f 100644 --- a/django-stubs/core/mail/backends/base.pyi +++ b/django-stubs/core/mail/backends/base.pyi @@ -1,5 +1,5 @@ import types -from typing import Any, TypeVar, Type, Iterable +from typing import Any, TypeVar, Type, Iterable, Optional from django.core.mail.message import EmailMessage @@ -7,7 +7,7 @@ _T = TypeVar("_T", bound="BaseEmailBackend") class BaseEmailBackend: def __init__(self, fail_silently: bool = ..., **kwargs: Any) -> None: ... - def open(self) -> bool: ... + def open(self) -> Optional[bool]: ... def close(self) -> None: ... def __enter__(self: _T) -> _T: ... def __exit__( diff --git a/scripts/enabled_test_modules.py b/scripts/enabled_test_modules.py index f7c7477..10bd145 100644 --- a/scripts/enabled_test_modules.py +++ b/scripts/enabled_test_modules.py @@ -229,7 +229,6 @@ IGNORED_ERRORS = { ], 'mail': [ 'List item 1 has incompatible type "None"; expected "str"', - 'Incompatible return value type (got "None", expected "bool")', 'Argument 1 to "push" of "SMTPChannel" has incompatible type "str"; expected "bytes"', 'Value of type "Union[List[Message], str, bytes, None]" is not indexable', 'Incompatible types in assignment '