From: Sam Bull Date: Mon, 13 Feb 2023 20:57:29 +0000 (-0500) Subject: Update annotation to allow PathLike X-Git-Tag: rel_1_9_4~5^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1178744984c5bf5d4b17f0e53b372c7d2b6b48;p=thirdparty%2Fsqlalchemy%2Falembic.git Update annotation to allow PathLike The value is only used in os.path.abspath(), so it works fine with Path. Closes: #1173 Pull-request: https://github.com/sqlalchemy/alembic/pull/1173 Pull-request-sha: 7cf9606602bb5692ddeb3551500be0dd956bd5d9 Change-Id: Ic629a7290464291377d066e856a8ae8a3f6505bc --- diff --git a/alembic/config.py b/alembic/config.py index ac27d585..338769b2 100644 --- a/alembic/config.py +++ b/alembic/config.py @@ -10,6 +10,7 @@ from typing import Dict from typing import Optional from typing import overload from typing import TextIO +from typing import Union from . import __version__ from . import command @@ -93,7 +94,7 @@ class Config: def __init__( self, - file_: Optional[str] = None, + file_: Union[str, os.PathLike[str], None] = None, ini_section: str = "alembic", output_buffer: Optional[TextIO] = None, stdout: TextIO = sys.stdout, @@ -123,7 +124,7 @@ class Config: """ - config_file_name: Optional[str] = None + config_file_name: Union[str, os.PathLike[str], None] = None """Filesystem path to the .ini file in use.""" config_ini_section: str = None # type:ignore[assignment]