File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -905,11 +905,12 @@ def initialize_app_directory(
905905
906906 console .debug (f"Using { template_name = } { template_dir = } { template_code_dir_name = } ." )
907907
908- # Remove all pyc and __pycache__ dirs in template directory.
909- for pyc_file in template_dir .glob ("**/*.pyc" ):
910- pyc_file .unlink ()
911- for pycache_dir in template_dir .glob ("**/__pycache__" ):
912- pycache_dir .rmdir ()
908+ # Remove __pycache__ dirs in template directory and current directory.
909+ for pycache_dir in [
910+ * template_dir .glob ("**/__pycache__" ),
911+ * Path .cwd ().glob ("**/__pycache__" ),
912+ ]:
913+ shutil .rmtree (pycache_dir , ignore_errors = True )
913914
914915 for file in template_dir .iterdir ():
915916 # Copy the file to current directory but keep the name the same.
You can’t perform that action at this time.
0 commit comments