]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
use Path.name for split target
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 May 2025 14:12:30 +0000 (10:12 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 20 May 2025 14:12:30 +0000 (10:12 -0400)
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

index b8a14b58fa4a5c36989a8e6219a45717435ef36e..34dd461f7dc3f9bb2d6a68826e45097be78205f7 100644 (file)
@@ -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: