From 00a1a043042ff70c69b69b727e5d55c34cd9cfd3 Mon Sep 17 00:00:00 2001 From: "Pavel V. Pristupa" Date: Thu, 25 Jul 2024 23:24:10 +0200 Subject: [PATCH] Strip leading and trailing spaces in version locations References: #1509 --- alembic/script/base.py | 2 +- tests/test_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/alembic/script/base.py b/alembic/script/base.py index d05a54d6..d3cccf6c 100644 --- a/alembic/script/base.py +++ b/alembic/script/base.py @@ -211,7 +211,7 @@ def from_config(cls, config: Config) -> ScriptDirectory: ) else: version_locations = [ - x for x in version_locations_str.split(split_char) if x + x.strip() for x in version_locations_str.split(split_char) if x ] else: version_locations = None diff --git a/tests/test_config.py b/tests/test_config.py index b30f04cc..a5ac0172 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -137,7 +137,7 @@ def test_attributes_constructor(self): ( "multiline string 1", "newline", - "/foo\n/bar", + " /foo \n/bar ", ["/foo", "/bar"], ), (