diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-02 12:39:20 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-12-02 12:39:20 -0500 |
commit | c0177fe25dc8d4802145bc7d035398333f0f99c0 (patch) | |
tree | d72a6e854e204a41c8be66fe0f365e6c26f1cd1b /coverage/config.py | |
parent | 7e876521b8016bf413871ded95fd71974580bc53 (diff) | |
download | python-coveragepy-c0177fe25dc8d4802145bc7d035398333f0f99c0.tar.gz |
debug sys shows the config files attempted, and the config files read.
Diffstat (limited to 'coverage/config.py')
-rw-r--r-- | coverage/config.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/coverage/config.py b/coverage/config.py index d8c40d2..c2ebecb 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -18,7 +18,7 @@ class HandyConfigParser(configparser.RawConfigParser): kwargs = {} if sys.version_info >= (3, 2): kwargs['encoding'] = "utf-8" - configparser.RawConfigParser.read(self, filename, **kwargs) + return configparser.RawConfigParser.read(self, filename, **kwargs) def get(self, *args, **kwargs): v = configparser.RawConfigParser.get(self, *args, **kwargs) @@ -101,6 +101,7 @@ class CoverageConfig(object): def __init__(self): """Initialize the configuration attributes to their defaults.""" # Metadata about the config. + self.attempted_config_files = [] self.config_files = [] # Defaults for [run] @@ -157,10 +158,12 @@ class CoverageConfig(object): `filename` is a file name to read. """ - self.config_files.append(filename) + self.attempted_config_files.append(filename) cp = HandyConfigParser() - cp.read(filename) + files_read = cp.read(filename) + if files_read is not None: # return value changed in 2.4 + self.config_files.extend(files_read) for option_spec in self.CONFIG_FILE_OPTIONS: self.set_attr_from_config_option(cp, *option_spec) |