From e72a1e269e32d06616f345a44f536864806540c9 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Thu, 29 Aug 2013 15:50:15 +0300 Subject: config: restore mangled env in doctests Otherwise the mangled GBP_CONF_FILES affects also other doctests when run with python-nose. Signed-off-by: Markus Lehtonen --- gbp/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gbp') diff --git a/gbp/config.py b/gbp/config.py index 84441b8..4952de4 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -286,7 +286,8 @@ class GbpOptionParser(OptionParser): @return: list of config files we need to parse @rtype: C{list} - >>> if os.environ.has_key('GBP_CONF_FILES'): del os.environ['GBP_CONF_FILES'] + >>> conf_backup = os.getenv('GBP_CONF_FILES') + >>> if conf_backup is not None: del os.environ['GBP_CONF_FILES'] >>> files = GbpOptionParser.get_config_files() # Remove the ~-expanded one @@ -297,6 +298,8 @@ class GbpOptionParser(OptionParser): >>> os.environ['GBP_CONF_FILES'] = 'test1:test2' >>> GbpOptionParser.get_config_files() ['test1', 'test2'] + >>> del os.environ['GBP_CONF_FILES'] + >>> if conf_backup is not None: os.environ['GBP_CONF_FILES'] = conf_backup """ envvar = os.environ.get('GBP_CONF_FILES') files = envvar.split(':') if envvar else klass.def_config_files -- cgit v1.2.3