diff scripts/pytouhou @ 570:f0252cf111d8

Don’t traceback when GTK+ isn’t available.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 10 Jul 2014 13:53:46 +0200
parents e7a4731a278b
children e35a083d4208
line wrap: on
line diff
--- a/scripts/pytouhou
+++ b/scripts/pytouhou
@@ -49,8 +49,12 @@ logger.root.name = 'pytouhou'
 logger.info('Configuration loaded from: %s', ', '.join(options.paths))
 
 if not args.no_menu:
-    from pytouhou.menu import menu
-    menu(options, args)
+    try:
+        from pytouhou.menu import menu
+    except ImportError:
+        logger.error('GTK+ unavailable, disabling the GUI menu.')
+    else:
+        menu(options, args)
 
 if args.game == 'EoSD':
     from pytouhou.games.eosd import EoSDCommon as Common, EoSDGame as Game