Skip to content

Commit 0ea3418

Browse files
authored
[Fix] too-lax component file location (#163)
1 parent ff4b102 commit 0ea3418

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mccode_antlr/reader/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ def to_file(self, output, wrapper):
147147
def known(self, name: str, ext: str = None, strict: bool = False):
148148
compare = _name_plus_suffix(name, ext)
149149
# the files *in* the registry are already posix paths, so that makes life easier
150-
if any(x.endswith(compare) for x in self.pooch.registry_files):
150+
if any(Path(x).name == compare for x in self.pooch.registry_files):
151151
return True
152152
if strict:
153153
return False
154154
# fall back to matching without the extension:
155-
if any(Path(x).with_suffix('').as_posix().endswith(compare) for x in self.pooch.registry_files):
155+
if any(Path(x).stem == compare for x in self.pooch.registry_files):
156156
return True
157157
# Or matching *any* file that contains name
158158
return any(name in x for x in self.pooch.registry_files)

0 commit comments

Comments
 (0)