File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
2
import os
3
3
import sys
4
+ from pathlib import Path
4
5
5
6
6
7
if sys .platform == "win32" :
@@ -65,11 +66,7 @@ def main():
65
66
# Print a warning if some cached modules were not removed, so that the
66
67
# user knows he should manually delete them, or call
67
68
# pytensor-cache purge, # to properly clear the cache.
68
- items = [
69
- item
70
- for item in sorted (os .listdir (cache .dirname ))
71
- if item .startswith ("tmp" )
72
- ]
69
+ items = list (Path (cache .dirname ).glob ("tmp*" ))
73
70
if items :
74
71
_logger .warning (
75
72
"There remain elements in the cache dir that you may "
Original file line number Diff line number Diff line change 77
77
78
78
import functools
79
79
import logging
80
- import os
81
80
import shlex
82
81
import warnings
83
82
from pathlib import Path
@@ -402,9 +401,9 @@ def _ldflags(
402
401
include_dir = False ,
403
402
)
404
403
for d in dirs :
405
- for f in os . listdir (d .strip ('"' )):
406
- if f .endswith ( ".so" ) or f . endswith ( ".dylib" ) or f . endswith ( ".dll" ) :
407
- if any (f .find (ll ) >= 0 for ll in l ):
404
+ for f in Path (d .strip ('"' )). iterdir ( ):
405
+ if f .suffix in { ".so" , ".dylib" , ".dll" } :
406
+ if any (f .stem . find (ll ) >= 0 for ll in l ):
408
407
found_dyn = True
409
408
# Special treatment of clang framework. Specifically for MacOS Accelerate
410
409
if "-framework" in l and "Accelerate" in l :
You can’t perform that action at this time.
0 commit comments