Skip to content

Commit 35274f2

Browse files
committed
address bar not being opened
1 parent 2a01f84 commit 35274f2

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

planet/reporting.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,13 @@ def desc(self):
145145
def update(self, status: str):
146146
self.status = status
147147

148-
try:
149-
self.bar.postfix[1] = self.status
150-
except AttributeError:
151-
# If the bar is disabled, attempting to access self.bar.postfix
152-
# will result in an error. In this case, just skip it.
153-
pass
154-
155-
self.bar.refresh()
148+
if self.bar is not None:
149+
try:
150+
self.bar.postfix[1] = self.status
151+
except AttributeError:
152+
# If the bar is disabled, attempting to access self.bar.postfix
153+
# will result in an error. In this case, just skip it.
154+
pass
155+
156+
if self.bar is not None:
157+
self.bar.refresh()

tests/unit/test_reporting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def test_AssetStatusBar_disabled():
7272

7373

7474
def test_AssetStatusBar_update():
75+
"""Status is changed with update"""
7576
with reporting.AssetStatusBar('item-type', 'item_id', 'asset_type') as bar:
7677
assert ('status: init') not in str(bar)
7778

0 commit comments

Comments
 (0)