From: Mike Bayer Date: Tue, 20 May 2025 14:12:30 +0000 (-0400) Subject: use Path.name for split target X-Git-Tag: rel_1_16_0~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=412e2d848e5b62428a9170008f0401ae1a7b9db4;p=thirdparty%2Fsqlalchemy%2Falembic.git 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 --- 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: