Skip to content

Commit

Permalink
Fix `Initialize Segment instance variables
Browse files Browse the repository at this point in the history
Initialize stats and branch of the Segment class to None.

This should hopefully fix the issue outline in b-ryan#408:

```
AttributeError: 'Segment' object has no attribute 'stats'
```
  • Loading branch information
Olshansk authored Feb 26, 2020
1 parent a9b8c9b commit 259398a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions powerline_shell/segments/hg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 259398a

Please sign in to comment.