Skip to content

Commit 625899d

Browse files
committed
Fix AttributeError
1 parent 8877312 commit 625899d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

robotframework_reportportal/listener.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ def start_launch(self, attributes: Dict[str, Any], ts: Optional[Any] = None) ->
226226
try:
227227
# noinspection PyUnresolvedReferences
228228
from robot.running.context import EXECUTION_CONTEXTS
229-
# noinspection PyProtectedMember
230-
self._remove_keywords = set(EXECUTION_CONTEXTS.current.output._settings.remove_keywords)
229+
current_context = EXECUTION_CONTEXTS.current
230+
if current_context:
231+
# noinspection PyProtectedMember
232+
self._remove_keywords = set(current_context.output._settings.remove_keywords)
231233
except ImportError:
232234
warn('Unable to locate Robot Framework context. "removekeywords" feature will not work.', stacklevel=2)
233235
pass

0 commit comments

Comments
 (0)