Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions pytensor/bin/pytensor_cache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import os
import sys
from pathlib import Path


if sys.platform == "win32":
Expand Down Expand Up @@ -65,11 +66,7 @@ def main():
# Print a warning if some cached modules were not removed, so that the
# user knows he should manually delete them, or call
# pytensor-cache purge, # to properly clear the cache.
items = [
item
for item in sorted(os.listdir(cache.dirname))
if item.startswith("tmp")
]
items = list(Path(cache.dirname).glob("tmp*"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this sorted by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it doesn't matter though

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not but yes it doesn't matter here

if items:
_logger.warning(
"There remain elements in the cache dir that you may "
Expand Down
7 changes: 3 additions & 4 deletions pytensor/tensor/blas.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@

import functools
import logging
import os
import shlex
import warnings
from pathlib import Path
Expand Down Expand Up @@ -402,9 +401,9 @@ def _ldflags(
include_dir=False,
)
for d in dirs:
for f in os.listdir(d.strip('"')):
if f.endswith(".so") or f.endswith(".dylib") or f.endswith(".dll"):
if any(f.find(ll) >= 0 for ll in l):
for f in Path(d.strip('"')).iterdir():
if f.suffix in {".so", ".dylib", ".dll"}:
if any(f.stem.find(ll) >= 0 for ll in l):
found_dyn = True
# Special treatment of clang framework. Specifically for MacOS Accelerate
if "-framework" in l and "Accelerate" in l:
Expand Down