File tree 1 file changed +9
-6
lines changed
Filter options
1 file changed +9
-6
lines changed
Original file line number Diff line number Diff line change @@ -79,17 +79,20 @@ def run(self):
79
79
shutil .rmtree ("build" )
80
80
for dirpath , dirnames , filenames in os .walk ("sklearn" ):
81
81
for filename in filenames :
82
- if any (
83
- filename .endswith (suffix )
84
- for suffix in (".so" , ".pyd" , ".dll" , ".pyc" )
85
- ):
82
+ root , extension = os .path .splitext (filename )
83
+
84
+ if extension in [".so" , ".pyd" , ".dll" , ".pyc" ]:
86
85
os .unlink (os .path .join (dirpath , filename ))
87
- continue
88
- extension = os .path .splitext (filename )[1 ]
86
+
89
87
if remove_c_files and extension in [".c" , ".cpp" ]:
90
88
pyx_file = str .replace (filename , extension , ".pyx" )
91
89
if os .path .exists (os .path .join (dirpath , pyx_file )):
92
90
os .unlink (os .path .join (dirpath , filename ))
91
+
92
+ if remove_c_files and extension == ".tp" :
93
+ if os .path .exists (os .path .join (dirpath , root )):
94
+ os .unlink (os .path .join (dirpath , root ))
95
+
93
96
for dirname in dirnames :
94
97
if dirname == "__pycache__" :
95
98
shutil .rmtree (os .path .join (dirpath , dirname ))
You can’t perform that action at this time.
0 commit comments