File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
python-bindings/overview_article Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 66import pathlib
77import sys
88import os
9+ import shutil
910import re
11+ import glob
1012
1113on_win = sys .platform .startswith ("win" )
1214
1315
1416@invoke .task
1517def clean (c ):
1618 """ Remove any built objects """
17- for pattern in (
19+ for file_pattern in (
1820 "*.o" ,
1921 "*.so" ,
2022 "*.obj" ,
2123 "*.dll" ,
2224 "*.exp" ,
2325 "*.lib" ,
2426 "*.pyd" ,
25- "cffi_example*" ,
27+ "cffi_example*" , # Is this a dir?
2628 "cython_wrapper.cpp" ,
2729 ):
28- if on_win :
29- c . run ( "del {} >nul 2>&1" . format ( pattern ) )
30- else :
31- c . run ( "rm -rf {}" . format ( pattern ))
32- if on_win :
33- c . run ( "rmdir /s /q Release >nul 2>&1" )
34-
30+ for file in glob . glob ( file_pattern ) :
31+ os . remove ( file )
32+ for dir_pattern in (
33+ "Release"
34+ ) :
35+ for dir in glob . glob ( dir_pattern ):
36+ shutil . rmtree ( dir )
3537
3638def print_banner (msg ):
3739 print ("==================================================" )
You can’t perform that action at this time.
0 commit comments