Skip to content

Commit e56efa6

Browse files
committed
Send update notices to stderr instead of stdout.
1 parent 91b2134 commit e56efa6

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

pebble_tool/util/updates.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,29 @@ def _check_version(self, new_version, release_notes=None):
5353
atexit.register(self.callback, new_version, release_notes)
5454

5555

56+
def _print(*args, **kwargs):
57+
print(*args, file=sys.stderr, **kwargs)
58+
59+
5660
def _handle_sdk_update(version, release_notes=None):
5761
# We know the SDK was new when the version check occurred, but it is possible that it's
5862
# been installed since then. Therefore, check again.
5963
if version not in sdk_manager.list_local_sdk_versions():
60-
print()
61-
print("A new SDK, version {0}, is available! Run `pebble sdk install {0}` to get it.".format(version))
64+
_print()
65+
_print("A new SDK, version {0}, is available! Run `pebble sdk install {0}` to get it.".format(version))
6266
if release_notes is not None:
63-
print(release_notes)
67+
_print(release_notes)
6468

6569

6670
def _handle_tool_update(version, release_notes=None):
67-
print()
68-
print("An updated pebble tool, version {}, is available.".format(version))
71+
_print()
72+
_print("An updated pebble tool, version {}, is available.".format(version))
6973
if release_notes is not None:
70-
print(release_notes)
74+
_print(release_notes)
7175
if 'PEBBLE_IS_HOMEBREW' in os.environ:
72-
print("Run `brew update && brew upgrade pebble-sdk` to get it.")
76+
_print("Run `brew update && brew upgrade pebble-sdk` to get it.")
7377
else:
74-
print("Head to https://developer.getpebble.com/sdk/beta/ to get it.")
78+
_print("Head to https://developer.getpebble.com/sdk/beta/ to get it.")
7579

7680

7781
def _get_platform():

0 commit comments

Comments
 (0)