Fix crash when AppIndicator3 is unavailable
Convert ValueError to an ImportError (hack!) to allow the fallback code to function. Fixes https://github.com/pwr/Solaar/pull/276
This commit is contained in:
parent
1edd8a577b
commit
c14e30b6f5
|
@ -145,7 +145,11 @@ def _scroll(tray_icon, event, direction=None):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('AppIndicator3', '0.1')
|
try:
|
||||||
|
gi.require_version('AppIndicator3', '0.1')
|
||||||
|
except ValueError:
|
||||||
|
# Treat unavailable versions the same as unavailable packages
|
||||||
|
raise ImportError
|
||||||
from gi.repository import AppIndicator3
|
from gi.repository import AppIndicator3
|
||||||
|
|
||||||
if _log.isEnabledFor(_DEBUG):
|
if _log.isEnabledFor(_DEBUG):
|
||||||
|
|
Loading…
Reference in New Issue