Use getattr instead of eval in the wscript
This commit is contained in:
parent
eff875e2e3
commit
a6cb1d8450
1 changed files with 5 additions and 5 deletions
10
wscript
10
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue