From d54622e341f8abb46df4147b91be52288b63765e Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Fri, 18 Mar 2016 19:54:31 +0100 Subject: [PATCH] Simplification: remove Configure.err_handler --- ChangeLog | 1 + waflib/Configure.py | 34 ++++------------------------------ 2 files changed, 5 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index f848a573..0ce3349b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/waflib/Configure.py b/waflib/Configure.py index 417bd4ae..c16527be 100644 --- a/waflib/Configure.py +++ b/waflib/Configure.py @@ -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): """