提交 f37ee844 authored 作者: Virgile Andreani's avatar Virgile Andreani 提交者: Virgile Andreani

Apply rule PTH208

上级 cbd662fc
import logging
import os
import sys
from pathlib import Path
if sys.platform == "win32":
......@@ -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*"))
if items:
_logger.warning(
"There remain elements in the cache dir that you may "
......
......@@ -77,7 +77,6 @@ Optimizations associated with these BLAS Ops are in tensor.rewriting.blas
import functools
import logging
import os
import shlex
import warnings
from pathlib import Path
......@@ -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:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论