diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2013-08-29 15:50:15 +0300 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-09-04 22:02:39 +0200 |
commit | e72a1e269e32d06616f345a44f536864806540c9 (patch) | |
tree | c4b510e67f074fe89aae17a0b959a6885dd27912 /gbp/config.py | |
parent | 4030c197f20e461603b4b60001e4055f6b6b1ee8 (diff) | |
download | git-buildpackage-e72a1e269e32d06616f345a44f536864806540c9.tar.gz git-buildpackage-e72a1e269e32d06616f345a44f536864806540c9.tar.bz2 git-buildpackage-e72a1e269e32d06616f345a44f536864806540c9.zip |
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 <markus.lehtonen@linux.intel.com>
Diffstat (limited to 'gbp/config.py')
-rw-r--r-- | gbp/config.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gbp/config.py b/gbp/config.py index 84441b86..4952de4a 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 |