diff options
author | Jonathan de Jong <jonathan@automatia.nl> | 2020-10-17 10:51:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-17 09:51:38 +0100 |
commit | 79c1f973cee73f2d24c1b9140500e1999b25a479 (patch) | |
tree | 8926943c4081c8794660f090c1e1aae2739ae56a /synapse | |
parent | Fix synmark (#8571) (diff) | |
download | synapse-79c1f973cee73f2d24c1b9140500e1999b25a479.tar.xz |
Pre-emptively fix synapse.storage.types.Connection for future mypy release (#8577)
Fix the Connection protocol according to typeshed's assertions about sqlite3.Connection
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/storage/database.py | 2 | ||||
-rw-r--r-- | synapse/storage/types.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/synapse/storage/database.py b/synapse/storage/database.py index 763722d6bc..0217e63108 100644 --- a/synapse/storage/database.py +++ b/synapse/storage/database.py @@ -160,7 +160,7 @@ class LoggingDatabaseConnection: self.conn.__enter__() return self - def __exit__(self, exc_type, exc_value, traceback) -> bool: + def __exit__(self, exc_type, exc_value, traceback) -> Optional[bool]: return self.conn.__exit__(exc_type, exc_value, traceback) # Proxy through any unknown lookups to the DB conn class. diff --git a/synapse/storage/types.py b/synapse/storage/types.py index 970bb1b9da..9cadcba18f 100644 --- a/synapse/storage/types.py +++ b/synapse/storage/types.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from typing import Any, Iterable, Iterator, List, Tuple +from typing import Any, Iterable, Iterator, List, Optional, Tuple from typing_extensions import Protocol @@ -65,5 +65,5 @@ class Connection(Protocol): def __enter__(self) -> "Connection": ... - def __exit__(self, exc_type, exc_value, traceback) -> bool: + def __exit__(self, exc_type, exc_value, traceback) -> Optional[bool]: ... |