Skip to content

Commit

Permalink
Fixed the incompatibility between Python 3.7 and 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom committed Mar 19, 2021
1 parent eb070f6 commit 99415b4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions notify_send_py/notify_send_py.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,20 @@ def notify(
# address = ('localhost', 6000)
try:
with open('/tmp/notify-send.py.address', 'rb') as pidf:
conn = Client(pidf.read())
address = pidf.read()
try:
conn = Client(address)
except ValueError:
conn = Client(address.decode('utf8'))
conn.send([n, replaces_process])
conn.close()
except Exception:
listener = Listener()
with open('/tmp/notify-send.py.address', 'wb') as pidf:
pidf.write(listener.address)
try:
pidf.write(listener.address)
except TypeError:
pidf.write(listener.address.encode('utf8'))
replaces_processes = {}
n.show()
replaces_processes[replaces_process] = n.id
Expand Down

0 comments on commit 99415b4

Please sign in to comment.