From 57eaee584de732511d9a5386870eb4ff2ebd9b59 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 10 Apr 2019 16:53:52 +0530 Subject: [PATCH] Fix checkout hook trying to delete chroot pyc files --- setup/git_post_checkout_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/git_post_checkout_hook.py b/setup/git_post_checkout_hook.py index 7d46791208..e482505771 100755 --- a/setup/git_post_checkout_hook.py +++ b/setup/git_post_checkout_hook.py @@ -25,5 +25,5 @@ if flags == '1': # A branch checkout for dirpath, dirnames, filenames in os.walk('.'): for f in filenames: fpath = os.path.join(dirpath, f) - if f.endswith('.pyc'): + if f.endswith('.pyc') and '/chroot/' not in fpath: os.remove(fpath)