From 4159a4698132f3b900a37f884119e5dae5a53e92 Mon Sep 17 00:00:00 2001 From: Florian Rathgeber Date: Fri, 20 Nov 2015 07:58:44 +0000 Subject: [PATCH] Fix setting of clean filter: call Python interpreter Otherwise setting the filter would point to the not executable pyc file once nbstripout has been called and the filter would fail. --- nbstripout.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nbstripout.py b/nbstripout.py index dfb2d47..af9d116 100755 --- a/nbstripout.py +++ b/nbstripout.py @@ -97,7 +97,8 @@ def install(): except CalledProcessError: print('Installation failed: not a git repository!', file=sys.stderr) sys.exit(1) - check_call(['git', 'config', 'filter.nbstripout.clean', "'%s'" % path.abspath(__file__)]) + check_call(['git', 'config', 'filter.nbstripout.clean', '%s %s' % + (sys.executable, path.abspath(__file__))]) check_call(['git', 'config', 'filter.nbstripout.smudge', 'cat']) check_call(['git', 'config', 'filter.nbstripout.required', 'true']) attrfile = path.join(git_dir, 'info', 'attributes')