Fixes Pyright type errors for src/flask/blueprint.py
This commit is contained in:
parent
8a6cdf1e2a
commit
06b3125207
2 changed files with 3 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ Version 3.1.0
|
|||
- ``Flask.open_resource``/``open_instance_resource`` and
|
||||
``Blueprint.open_resource`` take an ``encoding`` parameter to use when
|
||||
opening in text mode. It defaults to ``utf-8``. :issue:`5504`
|
||||
- Fixes Pyright type errors in ``src/flask/blueprint.py``. :issue:`5545`
|
||||
|
||||
Version 3.0.3
|
||||
-------------
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
|||
import os
|
||||
import typing as t
|
||||
from datetime import timedelta
|
||||
from io import BufferedReader
|
||||
|
||||
from .cli import AppGroup
|
||||
from .globals import current_app
|
||||
|
|
@ -103,7 +104,7 @@ class Blueprint(SansioBlueprint):
|
|||
|
||||
def open_resource(
|
||||
self, resource: str, mode: str = "rb", encoding: str | None = "utf-8"
|
||||
) -> t.IO[t.AnyStr]:
|
||||
) -> t.IO[t.AnyStr] | BufferedReader:
|
||||
"""Open a resource file relative to :attr:`root_path` for reading. The
|
||||
blueprint-relative equivalent of the app's :meth:`~.Flask.open_resource`
|
||||
method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue