Skip to content

Commit

Permalink
Minor fix of bug when loading empty file - data parameter may be None…
Browse files Browse the repository at this point in the history
… instead of MutableMapping type

Update dependencies
  • Loading branch information
Rud356 committed Jul 11, 2022
1 parent 162dce3 commit 7e9f72d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config_framework/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from config_framework import loaders, types, utils
from config_framework.types import BaseConfig, VariableKey, Variable

__version__ = "3.0.1"
__version__ = "3.0.2"
4 changes: 4 additions & 0 deletions config_framework/types/abstract/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ def __init__(
self, data: MutableMapping[str, Any],
defaults: MutableMapping[str, Any]
):
# Fixes errors when loader returns None from empty file or smt like that
if data is None:
data = {}

self.data = data
self.defaults = defaults

Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx~=4.5.0
sphinx~=5.0.2
sphinx-rtd-theme~=1.0.0
Pygments~=2.11.2
Pygments~=2.12.0
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ and at the same time powerful enough tool to create configs, validate them throu

Installing
==========
Pypi link: https://pypi.org/project/ConfigFramework

Install with command:
``pip install ConfigFramework``

Expand Down

0 comments on commit 7e9f72d

Please sign in to comment.