Skip to content

Commit

Permalink
Warn instead stder.write for linux notif errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ksamuel committed Sep 10, 2017
1 parent ea55cdc commit 9cd5693
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plyer/platforms/linux/notification.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
import subprocess
from plyer.facades import Notification
from plyer.utils import whereis_exe
Expand Down Expand Up @@ -47,9 +48,9 @@ def instance():
import dbus
return NotifyDbus()
except ImportError:
sys.stderr.write("python-dbus not installed. try:"
"`sudo pip install python-dbus`.")
msg = "python-dbus not installed. try: `sudo pip install python-dbus`."
warnings.warn(msg)
if whereis_exe('notify-send'):
return NotifySendNotification()
sys.stderr.write("notify-send not found.")
warnings.warn("notify-send not found.")
return Notification()

0 comments on commit 9cd5693

Please sign in to comment.