aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md6
-rw-r--r--config_file/config_file.py8
2 files changed, 8 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ad1669f..b76d2d9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## Unreleased
+
+Fixed
+
+- `isinstance` call for `BaseParser` to be correctly used.
+
## 0.3.0 - 2020-01-17
Added
diff --git a/config_file/config_file.py b/config_file/config_file.py
index a95aa2d..c47def2 100644
--- a/config_file/config_file.py
+++ b/config_file/config_file.py
@@ -1,11 +1,10 @@
from pathlib import Path
-from config_file.parsers.ini_parser import IniParser
from config_file.parsers.base_parser import BaseParser
+from config_file.parsers.ini_parser import IniParser
class ConfigFile:
-
def __init__(self, file_path: str, parser=None):
self.path = self.__create_config_path(file_path)
@@ -22,7 +21,7 @@ class ConfigFile:
return Path(file_path)
def __determine_parser(self, file_path: str, parser):
- if isinstance(BaseParser, parser):
+ if isinstance(parser, BaseParser):
return parser(self.contents)
file_type = self._split_on_dot(file_path, all_dots=True)[-1]
@@ -66,6 +65,3 @@ class ConfigFile:
it would only be checking if the section
"""
return self.parser.has(section_key)
-
-
-