mirror of https://gitlab.com/ita1024/waf.git
Simplification: remove Configure.err_handler
This commit is contained in:
parent
7960f19cb1
commit
d54622e341
|
@ -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
|
||||
|
||||
|
|
|
@ -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:
|
||||
if not f:
|
||||
self.fatal("No such configuration function %r" % x)
|
||||
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
|
||||
|
||||
def conf(f):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue