diff --git a/RobotDebug/RobotDebug.py b/RobotDebug/RobotDebug.py index 330dd85..5b04dc3 100644 --- a/RobotDebug/RobotDebug.py +++ b/RobotDebug/RobotDebug.py @@ -44,7 +44,8 @@ def start_keyword(self, name, attrs): path = attrs["source"] if path and Path(path).exists() and path not in self.source_files: - self.source_files[path] = Path(path).open().readlines() + with open(Path(path)) as f: + self.source_files[path] = f.readlines() lineno = attrs["lineno"] self.library.current_source_path = path self.library.current_source_line = lineno diff --git a/RobotDebug/robotlib.py b/RobotDebug/robotlib.py index c0f687d..5d8e38b 100644 --- a/RobotDebug/robotlib.py +++ b/RobotDebug/robotlib.py @@ -44,7 +44,7 @@ def build(self, resource): type="RESOURCE", scope="GLOBAL", ) - libdoc.keywords = KeywordDocBuilder().build_keywords(resource) + libdoc.keywords = KeywordDocBuilder(resource=True).build_keywords(resource) return libdoc