Merge pull request #1914 from Aurze/fix-1875

Fix for i3 if you have i3-py and i3ipc install
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2018-05-30 09:43:18 +03:00 committed by GitHub
commit e3c34e7136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,12 +25,13 @@ def i3_subscribe(conn, event, callback):
Function to run on event. Function to run on event.
''' '''
try: try:
import i3 import i3ipc
except ImportError: except ImportError:
pass import i3
else:
conn.Subscription(callback, event) conn.Subscription(callback, event)
return return
else:
pass
conn.on(event, callback) conn.on(event, callback)