From 259398a162d57b6062b90ebf8853d275499bd8f7 Mon Sep 17 00:00:00 2001 From: Daniel Olshansky Date: Wed, 26 Feb 2020 10:56:42 -0800 Subject: [PATCH] Fix `Initialize Segment instance variables Initialize stats and branch of the Segment class to None. This should hopefully fix the issue outline in https://github.com/b-ryan/powerline-shell/issues/408: ``` AttributeError: 'Segment' object has no attribute 'stats' ``` --- powerline_shell/segments/hg.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/powerline_shell/segments/hg.py b/powerline_shell/segments/hg.py index be784355..9d7b55a8 100644 --- a/powerline_shell/segments/hg.py +++ b/powerline_shell/segments/hg.py @@ -48,6 +48,9 @@ def build_stats(): class Segment(ThreadedSegment): + def __init__(self): + self.stats, self.branch = None, None + def run(self): self.stats, self.branch = build_stats()