Simplification: remove Configure.err_handler

This commit is contained in:
Thomas Nagy 2016-03-18 19:54:31 +01:00
parent 7960f19cb1
commit d54622e341
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 5 additions and 30 deletions

View File

@ -28,4 +28,5 @@ NEW IN WAF 1.9
- Modify Utils.run_once so that it accepts a list of *args
- Improve the task consumer in Runner.py
- Use relative paths in apply_incpaths by default (and absolute ones when paths cross drives)
- Remove Configure.err_handler

View File

@ -15,12 +15,6 @@ A :py:class:`waflib.Configure.ConfigurationContext` instance is created when ``w
import os, shlex, sys, time, re, shutil
from waflib import ConfigSet, Utils, Options, Logs, Context, Build, Errors
BREAK = 'break'
"""In case of a configuration error, break"""
CONTINUE = 'continue'
"""In case of a configuration error, continue"""
WAF_CONFIG_LOG = 'config.log'
"""Name of the configuration log file"""
@ -288,8 +282,7 @@ class ConfigurationContext(Context.Context):
def eval_rules(self, rules):
"""
Execute the configuration tests. The method :py:meth:`waflib.Configure.ConfigurationContext.err_handler`
is used to process the eventual exceptions
Execute configuration tests provided as list of funcitons to run
:param rules: list of configuration method names
:type rules: list of string
@ -297,28 +290,9 @@ class ConfigurationContext(Context.Context):
self.rules = Utils.to_list(rules)
for x in self.rules:
f = getattr(self, x)
if not f: self.fatal("No such method '%s'." % x)
try:
f()
except Exception as e:
ret = self.err_handler(x, e)
if ret == BREAK:
break
elif ret == CONTINUE:
continue
else:
raise
def err_handler(self, fun, error):
"""
Error handler for the configuration tests, the default is to let the exception raise
:param fun: configuration test
:type fun: method
:param error: exception
:type error: exception
"""
pass
if not f:
self.fatal("No such configuration function %r" % x)
f()
def conf(f):
"""