Project

General

Profile

Actions

Bug #8845

closed

Error in exception handling stops OSX version to start if there is an error with loading the GTK libs.

Added by Uwe Winter over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
02/28/2021
Due date:
% Done:

100%

Estimated time:
Chirp Version:
daily
Model affected:
(All models)
Platform:
MacOS
Debug Log:
I read the instructions above:

Description

For some reason CHIRP daily build was not able to load the GTK libraries as a result macapp is not initialised, causing a bug in chirp/chirp/ui/mainapp.py:

Uwes-MacBook-Pro-5340:MacOS uwe$ ./chirp 
2021-02-28 18:53:21.045 CHIRP[10254:39824] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead. 
WARNING: Icon  not found
test
Traceback (most recent call last):
  File "./../Resources/chirp/chirpw", line 132, in 
    a = mainapp.ChirpMain()
  File "/Users/uwe/Downloads/CHIRP-2.app/Contents/Resources/chirp/chirp/ui/mainapp.py", line 2266, in __init__
    self._init_macos(mbar)
  File "/Users/uwe/Downloads/CHIRP-2.app/Contents/Resources/chirp/chirp/ui/mainapp.py", line 2208, in _init_macos
    LOG.error("No MacOS support: %s" % e)
NameError: global name 'e' is not defined

The following patch resolves the e not defined issue:

--- Contents/Resources/chirp/chirp/ui/mainapp_old.py    2021-02-28 19:40:50.000000000 +1100
+++ Contents/Resources/chirp/chirp/ui/mainapp.py    2021-02-28 19:40:00.000000000 +1100
@@ -2193,14 +2193,14 @@
         try:
             import gtk_osxapplication
             macapp = gtk_osxapplication.OSXApplication()
-        except ImportError:
+        except ImportError as e:
             pass
 
         # for gtk-mac-integration >= 2.0.7
         try:
             import gtkosx_application
             macapp = gtkosx_application.Application()
-        except ImportError:
+        except ImportError as e:
             pass
 
         if macapp is None:
Actions

Also available in: Atom PDF