Mercurial > hgrepos > Python > libs > ConfigMix
diff configmix/yaml.py @ 207:b3b5ed34d180
Handle most flake8 errors and warnings.
NOTE: E265 "block comment should start with '# ' ist not yet handled.
We would need to adjust our Python style.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 05 May 2019 18:29:47 +0200 |
| parents | e2e8d21b4122 |
| children | bbe8513ea649 |
line wrap: on
line diff
--- a/configmix/yaml.py Sun May 05 16:53:13 2019 +0200 +++ b/configmix/yaml.py Sun May 05 18:29:47 2019 +0200 @@ -61,7 +61,9 @@ if isinstance(node, yaml.MappingNode): self.flatten_mapping(node) else: - raise yaml.constructor.ConstructorError(None, None, + raise yaml.constructor.ConstructorError( + None, + None, 'expected a mapping node, but found %s' % node.id, node.start_mark) @@ -73,7 +75,9 @@ except TypeError as err: raise yaml.constructor.ConstructorError( 'while constructing a mapping', node.start_mark, - 'found unacceptable key (%s)' % err, key_node.start_mark) + 'found unacceptable key (%s)' % (err, + key_node.start_mark) + ) value = self.construct_object(value_node, deep=deep) mapping[key] = value return mapping @@ -123,7 +127,9 @@ if isinstance(node, yaml.MappingNode): self.flatten_mapping(node) else: - raise yaml.constructor.ConstructorError(None, None, + raise yaml.constructor.ConstructorError( + None, + None, 'expected a mapping node, but found %s' % node.id, node.start_mark) @@ -135,7 +141,9 @@ except TypeError as err: raise yaml.constructor.ConstructorError( 'while constructing a mapping', node.start_mark, - 'found unacceptable key (%s)' % err, key_node.start_mark) + 'found unacceptable key (%s)' % (err, + key_node.start_mark) + ) value = self.construct_object(value_node, deep=deep) mapping[key] = value return mapping
