From 4d0264ab723ccebe8538635b9ccb288ef5fbadda Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 30 Apr 2019 23:42:34 -0700 Subject: [PATCH] filter-repo: workaround python<2.7.9 exec bug Python issue 21591 will cause SyntaxError messages to by thrown if using python versions prior to 2.7.9. Use the workaround identified in the bug report: use the exec statement instead of the exec function, even if this will need to be reverted for python3. Signed-off-by: Elijah Newren --- git-filter-repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-filter-repo b/git-filter-repo index 126e0c0..07c769c 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -2621,8 +2621,8 @@ class RepoFilter(object): def _handle_arg_callbacks(self): def make_callback(argname, str): - exec('def callback({}):\n'.format(argname)+ - ' '+'\n '.join(str.splitlines()), globals()) + exec 'def callback({}):\n'.format(argname)+\ + ' '+'\n '.join(str.splitlines()) in globals() return callback #namespace['callback'] def handle(type): callback_field = '_{}_callback'.format(type)