From a6cb1d845085d410da4997518bcbb16c2c986a8f Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 30 May 2009 23:56:31 +0200 Subject: [PATCH] Use getattr instead of eval in the wscript --- wscript | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wscript b/wscript index dd42f2fd..f0b80f00 100644 --- a/wscript +++ b/wscript @@ -38,23 +38,23 @@ srcdir = '.' blddir = '_build_' def option_enabled (option): - if eval ('Options.options.enable_' + option): + if getattr (Options.options, 'enable_' + option): return True - if eval ('Options.options.disable_' + option): + if getattr (Options.options, 'disable_' + option): return False return True def configure (conf): def option_checkfatal (option, desc): - if eval ('Options.options.enable_' + option): + if hasattr (Options.options, 'enable_' + option): Utils.pprint ('RED', desc + ' N/A') sys.exit (1) def dirname_default (dirname, default): - if eval ('Options.options.' + dirname) == '': + if getattr (Options.options, dirname) == '': dirvalue = default else: - dirvalue = eval ('Options.options.' + dirname) + dirvalue = getattr (Options.options, dirname) conf.define (dirname, dirvalue) return dirvalue