Merge pull request #3892 from lembacon/pycache

keg: `delete_pyc_files!` should also remove `__pycache__`
This commit is contained in:
Mike McQuaid 2018-03-08 09:02:09 +00:00 committed by GitHub
commit 1d708d77cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -522,7 +522,11 @@ class Keg
end
def delete_pyc_files!
find { |pn| pn.delete if %w[.pyc .pyo].include?(pn.extname) }
find do |path|
if %w[.pyc .pyo].include?(path.extname) || path.basename.to_s == "__pycache__"
path.delete
end
end
end
private