From 412e2d848e5b62428a9170008f0401ae1a7b9db4 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 20 May 2025 10:12:30 -0400 Subject: [PATCH] use Path.name for split target some code dealing with .pyc names that needs the first token of the dot-separated filename is clearer based on path.name, full filename, rather than .stem Change-Id: I2b289f279903027d32e071c79d60eac293f2bdb5 --- alembic/script/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alembic/script/base.py b/alembic/script/base.py index b8a14b58..34dd461f 100644 --- a/alembic/script/base.py +++ b/alembic/script/base.py @@ -980,12 +980,12 @@ class Script(revision.Revision): # already in the names we got from the version directory. # add as relative paths including __pycache__ token names = { - Path(filename).stem.split(".")[0] for filename in files + Path(filename).name.split(".")[0] for filename in files } paths.extend( py_cache_path / pyc for pyc in py_cache_path.iterdir() - if pyc.stem.split(".")[0] not in names + if pyc.name.split(".")[0] not in names ) if not scriptdir.recursive_version_locations: -- 2.47.3