From 782f070d48181e53504fc415b9d7515c95f8bedb Mon Sep 17 00:00:00 2001 From: Karl Linden Date: Sat, 5 Aug 2017 13:33:16 +0200 Subject: [PATCH] Do not create wrappers in a loop. The loop failed with SyntaxError under python2. --- __init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/__init__.py b/__init__.py index ac9df56..bc34617 100644 --- a/__init__.py +++ b/__init__.py @@ -180,11 +180,12 @@ class AutoOption: const='no', default='auto') - funcs = ['check', 'check_cfg', 'find_program'] - for fn in funcs: - def f(*k, fn=fn, **kw): - self.deps.append((fn, k, kw)) - setattr(self, fn, f) + def check(self, *k, **kw): + self.deps.append(('check', k, kw)) + def check_cfg(self, *k, **kw): + self.deps.append(('check_cfg', k, kw)) + def find_program(self, *k, **kw): + self.deps.append(('find_program', k, kw)) def add_function(self, func, *k, **kw): """ -- 2.11.4.GIT